diff -Nru autossh-1.4c/debian/autossh.default autossh-1.4c/debian/autossh.default --- autossh-1.4c/debian/autossh.default 2012-04-25 08:55:33.000000000 +0000 +++ autossh-1.4c/debian/autossh.default 2012-11-18 12:24:08.000000000 +0000 @@ -16,6 +16,9 @@ #AUTOSSH_DEBUG=yes #AUTOSSH_POLL=600 #AUTOSSH_GATETIME=30 +#AUTOSSH_LOGLEVEL=9 +AUTOSSH_IHOST=google.com +AUTOSSH_IPORT=80 # Below parameters must be unset to flush settings between sessions # diff -Nru autossh-1.4c/debian/autossh.init autossh-1.4c/debian/autossh.init --- autossh-1.4c/debian/autossh.init 2012-04-25 08:47:51.000000000 +0000 +++ autossh-1.4c/debian/autossh.init 2012-11-18 12:30:18.000000000 +0000 @@ -53,6 +53,24 @@ fi done + if [ -n "${AUTOSSH_IHOST}" ] && [ -n "${AUTOSSH_IPORT}" ]; then + log_action_begin_msg "Waiting for internet [${AUTOSSH_IHOST}:${AUTOSSH_IPORT}]" + PAUSE=1; RESULT=1 + while [ "${RESULT}" != 0 ]; do + nc -w 3 -z ${AUTOSSH_IHOST} ${AUTOSSH_IPORT} + RESULT=$? + if [ "${RESULT}" != 0 ]; then + sleep ${PAUSE} + fi + if [ ${PAUSE} -le 8 ]; then + PAUSE=$((PAUSE*2)) + log_action_begin_msg "Doubling sleep delay to [${PAUSE}]" + else + break + fi + done + fi + for config in ${configs}; do # Validating, resetting defaults and loading config [ -r ${config} ] || continue diff -Nru autossh-1.4c/debian/changelog autossh-1.4c/debian/changelog --- autossh-1.4c/debian/changelog 2012-04-25 09:31:59.000000000 +0000 +++ autossh-1.4c/debian/changelog 2012-11-18 12:31:22.000000000 +0000 @@ -1,3 +1,10 @@ +autossh (1.4c-1.2~eugenesan~oneiric1) oneiric; urgency=low + + [ Eugene San (eugenesan) ] + * Add support for internet connection validation + + -- Eugene San (eugenesan) Sun, 18 Nov 2012 14:01:58 +0200 + autossh (1.4c-1.1~eugenesan~oneiric2) oneiric; urgency=low [ Eugene San (eugenesan) ]