Xentrk
Part of the Furniture
Although the script works, there are two issues you may want to correct per ShellCheck.Well, in fact this problem started happening after an upgrade to 384.11_2- and subsequent reset attempts did not fix it, besides it was happening for several other users in this forum. Now, with 384.12 beta1 it still happens. However, I am working with Eric and I have a few tests to do in the next couple of hours... meanwhile I have been able to get the script bypass working again. The idea is in post_mount script wait until ntp is sunchronized and then start the OVPN services through the appropriate command (note that this script is adapted / fixed from another post's suggestion ) :
Code:#!/bin/sh #/jffs/scripts/post-mount #Delay openvpn until time synced. Set openvpn status to OFF through GUI c=0 while [ $(date +%Y) -lt 2019 -a $c -lt 30 ] do c=`expr $c + 1` logger "OVPN Waiting for Time Adjustment...." sleep 3s done logger "Starting OVPN Services" #To start vpnclient also uncomment next two lines #service start_vpnclient1 #sleep 10s service start_vpnserver1
SC2046: Quote this to prevent word splitting.
^-- SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
SC2006: Use $(...) notation instead of legacy backticked `...`.
^-- SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
Did you mean: (apply this, apply all SC2006)
c=$(expr $c + 1)
^-- SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
SC2006: Use $(...) notation instead of legacy backticked `...`.
^-- SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
Did you mean: (apply this, apply all SC2006)
c=$(expr $c + 1)
Here is the POSIX compliant version of the script:
Code:
#!/bin/sh
#/jffs/scripts/post-mount
#Delay openvpn until time synced. Set openvpn status to OFF through GUI
c=0
while [ "$(date +%Y)" -lt 2019 ] && [ "$c" -lt 30 ]
do
c=$((c + 1))
logger "OVPN Waiting for Time Adjustment...."
sleep 3s
done
logger "Starting OVPN Services"
#To start vpnclient also uncomment next two lines
#service start_vpnclient1
#sleep 10s
service start_vpnserver1
Last edited: