mirror of
https://github.com/ivanilves/xiringuito.git
synced 2025-06-01 06:50:16 -07:00
Check, if we run OUTDATED version
This commit is contained in:
parent
f94762b983
commit
cbb859efc0
14
scripts/client-check-if-outdated.sh
Executable file
14
scripts/client-check-if-outdated.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Check, if we are behind the latest master (and warn if we are)
|
||||||
|
#
|
||||||
|
set -e
|
||||||
|
|
||||||
|
git remote update >/dev/null
|
||||||
|
|
||||||
|
REMOTE_TS=$(git show --pretty="format:%ct" origin master)
|
||||||
|
LOCAL_TS=$(git show --pretty="format:%ct")
|
||||||
|
|
||||||
|
if [[ ${LOCAL_TS} -lt ${REMOTE_TS} ]]; then
|
||||||
|
echo "*** WARNING: You are running outdated Xiringuito version. Remember: 'git pull' FTW!"
|
||||||
|
fi
|
@ -9,6 +9,7 @@ function print_help() {
|
|||||||
echo
|
echo
|
||||||
echo "OPTIONS"
|
echo "OPTIONS"
|
||||||
echo "-f X fail connection after X ping failures"
|
echo "-f X fail connection after X ping failures"
|
||||||
|
echo "-C do not check if we run outdated app version"
|
||||||
echo "-R do not reconnect after connection failure"
|
echo "-R do not reconnect after connection failure"
|
||||||
echo "-D do not fetch DNS config from server"
|
echo "-D do not fetch DNS config from server"
|
||||||
echo "-h show this extremely helpful message"
|
echo "-h show this extremely helpful message"
|
||||||
@ -51,6 +52,9 @@ while getopts "f:RDrh" o; do
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
C)
|
||||||
|
DONT_CHECK_IF_OUTDATED=true
|
||||||
|
;;
|
||||||
R)
|
R)
|
||||||
NO_RECONNECT=true
|
NO_RECONNECT=true
|
||||||
;;
|
;;
|
||||||
@ -70,6 +74,10 @@ while getopts "f:RDrh" o; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ ! ${DONT_CHECK_IF_OUTDATED} ]]; then
|
||||||
|
./scripts/client-check-if-outdated.sh 2>/dev/null &
|
||||||
|
fi
|
||||||
|
|
||||||
declare -r MAX_FAILED_PINGS=${MAX_FAILED_PINGS-10}
|
declare -r MAX_FAILED_PINGS=${MAX_FAILED_PINGS-10}
|
||||||
|
|
||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user