pkg_apply_save() { . /mod/etc/conf/openvpn.cfg if [ "$OPENVPN_CONFIG_COUNT" -gt 1 ]; then /mod/etc/default.openvpn/openvpn_dynamic_conf changed="${OPENVPN_CONFIG_CHANGED#*#}" for d in $(echo "openvpn${OPENVPN_CONFIG_NAMES#*DEFAULT#}" | sed 's/#/ openvpn_/g'); do if [ "${changed%%#*}" == "yes" -a ! -z "$(pidof "$d")" ]; then echo "Change in config of running daemon $d. Restarting ..." "/mod/etc/init.d/rc.$d" restart fi changed=${changed#*#} done else rm -f /mod/etc/openvpn_multid.pkg [ $(ls /mod/etc/init.d/rc.openvpn* | wc -l) -eq 1 ] || /mod/etc/default.openvpn/openvpn_dynamic_conf start_stop openvpn "$oldstatus1" fi } pkg_apply_def() { [ $(ls /mod/etc/init.d/rc.openvpn* | wc -l) -eq 1 ] || /mod/etc/default.openvpn/openvpn_dynamic_conf start_stop openvpn "$oldstatus1" } apply_changes() { :; } pkg_post_save() { . /mod/etc/conf/openvpn.cfg if [ "$OPENVPN_CONFIG_COUNT" -eq 1 -a "$OPENVPN_ENABLED" = inetd ]; then /mod/etc/default.openvpn/openvpn_conf > /mod/etc/openvpn.conf echo "Generated config for openvpn" fi # enable/disable inetd [ -x /mod/etc/init.d/rc.inetd ] && /mod/etc/init.d/rc.inetd config openvpn }