detached install-source

This commit is contained in:
xdrm-brackets 2017-01-26 15:40:45 +01:00
parent 3a5460bb31
commit 9726e537cb
5 changed files with 27 additions and 24 deletions

View File

@ -0,0 +1,25 @@
#!/bin/sh
# [1] First install only
#========================================================#
if [ -e /home/sats/satsd/first_install ]; then
dpkg -s git 2>/dev/null >/dev/null && gitinstalled=1 || gitinstalled=0;
# (1) With git if installed #
if [ $gitinstalled -eq 1 ]; then
git clone ssh://smmp-server/satsd/git /home/sats/satsd/source \
&& rm /home/sats/satsd/first_install \
|| exit;
# (2) Without git installed #
else
# temporary replacement (without git)
scp -r smmp-server:/satsd/scp/source /home/sats/satsd/ \
&& rm /home/sats/satsd/first_install \
|| exit;
fi;
fi;

View File

@ -12,4 +12,4 @@ echo "$RANDOM_PASS\n$RANDOM_PASS\n" | sudo passwd pi;
sudo systemctl start ssh; sudo systemctl start ssh;
# [4] Try to install necessary packages # [4] Try to install necessary packages
sudo apt-get -y install git; sudo apt-get -y install git php5 php5-cli;

View File

@ -2,7 +2,6 @@
Description=SATS Boot Process Description=SATS Boot Process
Requires=network-online.target Requires=network-online.target
After=network-online.target network.target After=network-online.target network.target
Before=sats-loop.service
[Service] [Service]
Type=oneshot Type=oneshot

View File

@ -4,27 +4,7 @@
test $# -lt 1 && exit; test $# -lt 1 && exit;
# [1] first install (install source code) # [1] first install (install source code)
if [ -e /home/sats/satsd/first_install ]; then sh /home/sats/satsd/install-source;
dpkg -s git 2>/dev/null >/dev/null && usegit=1 || usegit=0;
# install source code
if [ $usegit -eq 1 ]; then
git clone ssh://smmp-server/satsd/git /home/sats/satsd/source \
&& rm /home/sats/satsd/first_install \
|| exit;
else
# temporary replacement (without git)
scp -r smmp-server:/satsd/scp/source /home/sats/satsd/ \
&& rm /home/sats/satsd/first_install \
|| exit;
fi;
fi;
# [2] Propagate script # [2] Propagate script
if [ "$1" = "daemon" ]; then if [ "$1" = "daemon" ]; then

View File

@ -1,7 +1,6 @@
[Unit] [Unit]
Description=SATS (Secure Authentication and Tracking SYSTEM) Daemon Description=SATS (Secure Authentication and Tracking SYSTEM) Daemon
Wants=sats-boot.service Wants=sats-boot.service
After=sats-boot.service
[Service] [Service]
Type=simple Type=simple