Updated loop/boot scripts + service + remote origins
This commit is contained in:
parent
079e755410
commit
efb26a81b0
|
@ -6,6 +6,8 @@ if [ -e /home/sats/satsd/first_install ]; then
|
|||
|
||||
dpkg -s git 2>/dev/null >/dev/null && gitinstalled=1 || gitinstalled=0;
|
||||
|
||||
BRANCH=$(cat /home/sats/satsd/conf/branch);
|
||||
|
||||
# (1) With git if installed #
|
||||
if [ $gitinstalled -eq 1 ]; then
|
||||
|
||||
|
@ -17,7 +19,7 @@ if [ -e /home/sats/satsd/first_install ]; then
|
|||
else
|
||||
|
||||
# temporary replacement (without git)
|
||||
scp -r smmp-server:/satsd/scp/source /home/sats/satsd/ \
|
||||
scp -r smmp-server:/satsd/scp/$BRANCH/source /home/sats/satsd/ \
|
||||
&& rm /home/sats/satsd/first_install \
|
||||
|| exit;
|
||||
fi;
|
||||
|
|
|
@ -12,4 +12,5 @@ echo "$RANDOM_PASS\n$RANDOM_PASS\n" | sudo passwd pi;
|
|||
sudo systemctl start ssh;
|
||||
|
||||
# [4] Try to install necessary packages
|
||||
sudo apt-get update;
|
||||
sudo apt-get -y install git php5 php5-cli php-curl;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
Description=SATS Boot Process
|
||||
Requires=network-online.target
|
||||
After=network-online.target network.target
|
||||
Before=sats-loop.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
|
|
@ -4,11 +4,13 @@
|
|||
test $# -lt 1 && exit;
|
||||
|
||||
# [1] first install (install source code)
|
||||
sh /home/sats/satsd/install-source;
|
||||
sh /home/sats/satsd/install-source 2> /home/sats/satsd/log/install-source.log > /home/sats/satsd/log/install-source.log;
|
||||
|
||||
|
||||
# [2] Propagate script
|
||||
if [ "$1" = "daemon" ]; then
|
||||
|
||||
|
||||
sh /home/sats/satsd/source/daemon 2>> /home/sats/satsd/log/daemon.log >> /home/sats/satsd/log/daemon.log;
|
||||
|
||||
elif [ "$1" = "update" ]; then
|
||||
|
|
Loading…
Reference in New Issue