1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

Merge branch 'openvpn-handle' of https://github.com/holta/iiab

This commit is contained in:
root 2018-08-14 05:34:44 -04:00
commit 7fa38be472

View file

@ -1,14 +1,14 @@
#!/bin/bash -x #!/bin/bash -x
# small daemon to identify this machine to the openvpn server # Small daemon to identify this machine to the OpenVPN server
HANDLE= HANDLE=
UUID= UUID=
if [ -f /etc/iiab/openvpn_handle ]; then if [ -f /etc/iiab/openvpn_handle ]; then
# Option #0: might source directly from /etc/iiab/local_vars.yml in future # Option #0: Might source directly from /etc/iiab/local_vars.yml in future
# Option #1 # Option #1
HANDLE=`cat /etc/iiab/openvpn_handle` HANDLE=`cat /etc/iiab/openvpn_handle`
else else
# Option #2: dangerous to invoke hypothetical variables :( # Option #2: Dangerous to invoke hypothetical variables :(
source /etc/iiab/iiab.env source /etc/iiab/iiab.env
# Option #3: CAUSED FAILURES IN AUGUST 2018, invoking stale variable from /etc/iiab/iiab.ini, but safer now that relegated to #3 ? # Option #3: CAUSED FAILURES IN AUGUST 2018, invoking stale variable from /etc/iiab/iiab.ini, but safer now that relegated to #3 ?
if [ -z "$HANDLE" ]; then if [ -z "$HANDLE" ]; then
@ -23,9 +23,10 @@ fi
SERVER=/usr/bin/ncat SERVER=/usr/bin/ncat
ID=`printf "HANDLE = %s|UUID = %s" $HANDLE $UUID` ID=`printf "HANDLE = %s|UUID = %s" $HANDLE $UUID`
# August 2018: Removal of trailing slash tested on Raspbian, Ubuntu 18.04 & Ubuntu 16.04
#ID=`printf "HANDLE = %s|UUID = %s|" $HANDLE $UUID` #ID=`printf "HANDLE = %s|UUID = %s|" $HANDLE $UUID`
# start the daemon which will serve the handle on demand # Start the daemon which will serve the handle on demand
{% if is_debuntu %} {% if is_debuntu %}
$SERVER -l -k -p1705 --exec "/bin/echo $ID" & $SERVER -l -k -p1705 --exec "/bin/echo $ID" &
{% else %} {% else %}