2017-01-26 14:40:45 +00:00
|
|
|
#!/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;
|
|
|
|
|
2017-01-28 10:42:16 +00:00
|
|
|
BRANCH=$(cat /home/sats/satsd/conf/machine.branch);
|
2017-01-26 15:40:46 +00:00
|
|
|
|
2017-01-26 14:40:45 +00:00
|
|
|
# (1) With git if installed #
|
|
|
|
if [ $gitinstalled -eq 1 ]; then
|
|
|
|
|
2017-01-26 15:05:08 +00:00
|
|
|
git clone -b $BRANCH ssh://smmp-server/satsd/git /home/sats/satsd/source \
|
2017-01-26 14:40:45 +00:00
|
|
|
&& rm /home/sats/satsd/first_install \
|
|
|
|
|| exit;
|
|
|
|
|
|
|
|
# (2) Without git installed #
|
|
|
|
else
|
|
|
|
|
|
|
|
# temporary replacement (without git)
|
2017-01-26 15:40:46 +00:00
|
|
|
scp -r smmp-server:/satsd/scp/$BRANCH/source /home/sats/satsd/ \
|
2017-01-26 14:40:45 +00:00
|
|
|
&& rm /home/sats/satsd/first_install \
|
|
|
|
|| exit;
|
|
|
|
fi;
|
|
|
|
|
|
|
|
fi;
|