setup/clone/utility/install-source

28 lines
825 B
Plaintext
Raw Normal View History

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;
BRANCH=$(cat /home/sats/satsd/conf/machine.branch);
2017-01-26 14:40:45 +00:00
# (1) With git if installed #
if [ $gitinstalled -eq 1 ]; then
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)
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;