2017-01-24 17:29:16 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# [1] first install (install source code)
|
|
|
|
if [ -e /home/sats/satsd/first_install ]; then
|
|
|
|
|
2017-01-25 12:55:14 +00:00
|
|
|
git 2> /dev/null > /dev/null;
|
|
|
|
|
|
|
|
usegit=1;
|
|
|
|
|
|
|
|
test $? -ne 0 && usegit=0;
|
|
|
|
|
2017-01-24 17:29:16 +00:00
|
|
|
# install source code
|
2017-01-25 12:55:14 +00:00
|
|
|
if [ "$usegit" -eq 1 ]; then
|
|
|
|
|
|
|
|
git clone ssh://smmp-server/satsd/git /home/sats/satsd/source \
|
|
|
|
&& rm /home/sats/satsd/first_install \
|
|
|
|
|| exit;
|
|
|
|
|
|
|
|
else
|
2017-01-24 17:29:16 +00:00
|
|
|
|
2017-01-25 12:55:14 +00:00
|
|
|
# temporary replacement (without git)
|
|
|
|
scp -r smmp-server:/satsd/scp/source /home/sats/satsd/ \
|
|
|
|
&& rm /home/sats/satsd/first_install \
|
|
|
|
|| exit;
|
|
|
|
fi;
|
|
|
|
|
|
|
|
fi;
|
2017-01-24 17:29:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
# [2] Propagate script
|
2017-01-25 12:55:14 +00:00
|
|
|
sh /home/sats/satsd/source/boot $* 2>> /home/sats/satsd/log/boot.log >> /home/sats/satsd/log/boot.log;
|