#!/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/branch); # (1) With git if installed # if [ $gitinstalled -eq 1 ]; then git clone -b $BRANCH 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/$BRANCH/source /home/sats/satsd/ \ && rm /home/sats/satsd/first_install \ || exit; fi; fi;