mirror of
https://github.com/ivanilves/xiringuito.git
synced 2025-05-27 20:40:19 -07:00
Merge pull request #27 from ivanilves/feature/check-if-outdated
Check, if we run OUTDATED version
This commit is contained in:
commit
d4772fd133
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 "OPTIONS"
|
||||
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 "-D do not fetch DNS config from server"
|
||||
echo "-h show this extremely helpful message"
|
||||
@ -51,6 +52,9 @@ while getopts "f:RDrh" o; do
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
C)
|
||||
DONT_CHECK_IF_OUTDATED=true
|
||||
;;
|
||||
R)
|
||||
NO_RECONNECT=true
|
||||
;;
|
||||
@ -70,6 +74,10 @@ while getopts "f:RDrh" o; do
|
||||
esac
|
||||
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}
|
||||
|
||||
shift $((OPTIND-1))
|
||||
|
Loading…
x
Reference in New Issue
Block a user