Browse Source

update

master
zeus 4 years ago
parent
commit
47297714e2
  1. 4
      restart.sh
  2. 1
      start.sh
  3. 20
      update-agent.sh

4
restart.sh

@ -0,0 +1,4 @@
#!/bin/sh
./stop.sh
./start.sh

1
start.sh

@ -1,5 +1,6 @@
wdir=$PWD wdir=$PWD
./update-agent.sh
cd src-local cd src-local
./start-server.sh ./start-server.sh
cd $wdir cd $wdir

20
update-agent.sh

@ -0,0 +1,20 @@
#!/bin/sh
git fetch
UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM")
BASE=$(git merge-base @ "$UPSTREAM")
if [ $LOCAL = $REMOTE ]; then
echo "Up-to-date"
elif [ $LOCAL = $BASE ]; then
echo "Update swarmlab hybrid ..."
git pull origin
elif [ $REMOTE = $BASE ]; then
echo "Need to push"
else
echo "Diverged"
fi
Loading…
Cancel
Save