diff --git a/roles/openvpn/templates/announcer b/roles/openvpn/templates/announcer.j2 similarity index 71% rename from roles/openvpn/templates/announcer rename to roles/openvpn/templates/announcer.j2 index 26de78019..8c3f05482 100755 --- a/roles/openvpn/templates/announcer +++ b/roles/openvpn/templates/announcer.j2 @@ -3,23 +3,24 @@ HANDLE= UUID= -source /etc/iiab/iiab.env + if [ -f /etc/iiab/openvpn_handle ]; then HANDLE=`cat /etc/iiab/openvpn_handle` +else + source /etc/iiab/iiab.env + # DANGEROUS AS OF AUGUST 2018: + if [ -z "$HANDLE" ]; then + HANDLE=`cat /etc/iiab/iiab.ini | gawk \ + '{ if((toupper($1) == "HANDLE") && ($2 == "=")) { print $3;}}'` + fi fi -# DANGEROUS AS OF AUGUST 2018: -#if [ -z "$HANDLE" ]; then -# HANDLE=`cat /etc/iiab/iiab.ini | gawk \ -# '{ if((toupper($1) == "HANDLE") && ($2 == "=")) { print $3;}}'` -#fi if [ -f /etc/iiab/uuid ]; then - UUID=`cat /etc/iiab/uuid` + UUID=`cat /etc/iiab/uuid` fi # start the daemon which will serve the handle on demand # NEXT LINE OBSOLETE? August 2018 source /etc/init.d/functions SERVER=/usr/bin/ncat -# NEXT LINE OBSOLETE? August 2018 PID_FILE=/var/run/openvpn/announce.pid HANDLE=${HANDLE// /_} {% if is_debuntu %}