Changeset 2326


Ignore:
Timestamp:
Sep 19, 2013, 2:42:30 PM (5 years ago)
Author:
matthijs
Message:

luci: Fix backup of OpenVPN port numbers

The OpenVPN port number is stored in two places: In the OpenVPN config
and in the services config. Before, the save-config.sh script tried to
backup both, but it failed with the services config due to forgotten
$().

However, this wasn't originally noticed, because on boot the UMTS
fonstated script would run, which would call ReconfOpenVPN, which would
copy the port number from the OpenVPN config into the services config.
Now that this UMTS script is gone, the bug actually surfaced.

Instead of fixing the missing $(), we now just call the ReconfOpenVPN
script after importing the OpenVPN config to fix the services config.

Closes: #1257

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/luci/modules/admin-fon/root/sbin/save-config.sh

    r2301 r2326  
    132132echo "EOF"
    133133echo "uci commit openvpn"
    134 
     134# Run the ReconfOpenVPN script to update /etc/config/services with the
     135# proper port numbers
     136echo "/etc/fonstated/ReconfOpenVPN"
    135137config_clear
    136 
    137 # The OpenVPN port settings are duplicated in the services config, so
    138 # backup those as well.
    139 echo "uci delete services.openvpn.tcp_port"
    140 for p in uci get services.openvpn.tcp_port; do
    141         echo "uci add_list 'services.openvpn.tcp_port=$p'"
    142 done
    143 echo "uci delete services.openvpn.udp_port"
    144 for p in uci get services.openvpn.udp_port; do
    145         echo "uci add_list 'services.openvpn.udp_port=$p'"
    146 done
    147 
    148138
    149139# Save luci language setting
Note: See TracChangeset for help on using the changeset viewer.