detached install-source
This commit is contained in:
parent
3a5460bb31
commit
9726e537cb
|
@ -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;
|
|
@ -12,4 +12,4 @@ echo "$RANDOM_PASS\n$RANDOM_PASS\n" | sudo passwd pi;
|
|||
sudo systemctl start ssh;
|
||||
|
||||
# [4] Try to install necessary packages
|
||||
sudo apt-get -y install git;
|
||||
sudo apt-get -y install git php5 php5-cli;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
Description=SATS Boot Process
|
||||
Requires=network-online.target
|
||||
After=network-online.target network.target
|
||||
Before=sats-loop.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
|
|
@ -4,27 +4,7 @@
|
|||
test $# -lt 1 && exit;
|
||||
|
||||
# [1] first install (install source code)
|
||||
if [ -e /home/sats/satsd/first_install ]; then
|
||||
|
||||
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;
|
||||
|
||||
sh /home/sats/satsd/install-source;
|
||||
|
||||
# [2] Propagate script
|
||||
if [ "$1" = "daemon" ]; then
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
[Unit]
|
||||
Description=SATS (Secure Authentication and Tracking SYSTEM) Daemon
|
||||
Wants=sats-boot.service
|
||||
After=sats-boot.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
|
Loading…
Reference in New Issue