Update
This commit is contained in:
parent
cc298567cd
commit
fe8f94c4bb
23
push.sh
23
push.sh
|
@ -1,7 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
ip1="10.120.152.1"
|
||||
ip2="192.168.1.250"
|
||||
|
||||
ip r | grep 10.120.152.1
|
||||
if [[ $? == 0 ]]; then
|
||||
ping -c 1 10.120.152.1
|
||||
if [[ $? == 0 ]]; then
|
||||
ip=$ip1
|
||||
fi
|
||||
else
|
||||
ping -c 1 192.168.1.250
|
||||
if [[ $? == 0 ]]; then
|
||||
ip=$ip2
|
||||
fi
|
||||
fi
|
||||
|
||||
git add . && git commit -m "Update" && git push
|
||||
|
||||
ssh home -f '~/update-site.sh'
|
||||
ssh ${ip} -f '~/update-site.sh'
|
||||
status=$?
|
||||
|
||||
echo "Ready"
|
||||
if [ "$status" == 0 ]; then
|
||||
sleep 5
|
||||
kill $(ps x | grep konsole | grep $0 | awk '{print $1}')
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue