${gateway:+$DEBUG route add default gw $gateway}
[ -n "$static_route" ] && {
- for route in $static_route; do
- if [ "$(echo $route | cut -d \/ -f2)" != "32" ];
- then
- route add -net $(echo $route | cut -d \/ -f1) netmask $(echo $route | cut -d \/ -f1) dev $if
- else
- route add -host $(echo $route | cut -d \/ -f1) dev $if
+ for route in $static_route; do {
+ eval "set $(echo $route | sed 's/:/ /g')"
+ if [ "$2" = "255.255.255.255" ]; then
+ opt="-host"
fi
- done
+ $DEBUG route add ${opt:-"-net"} $1 netmask $2 gw $3 metric $4
+ } done
}
[ -f /etc/resolv.conf ] || {
debug "### wla2-g54l hacks ###"
nvram_default wan_ifname "none"
fixup_lan "vlan0" "vlan0 eth1"
+ nvram_default vlan0ports "1 2 5t"
+ nvram_default vlan1ports "3 4 5t"
}
# wrtsl54gs vlan defaults
#!/bin/sh
case "$1" in
start|restart)
- ifup lan
- ifup wan
- ifup wifi
- wifi up
-
- for route in $(nvram get static_route); do {
- eval "set $(echo $route | sed 's/:/ /g')"
- $DEBUG route add -net $1 netmask $2 gw $3 metric $4 dev $5
- } done
- ;;
+ ifup_interfaces=$(nvram get ifup_interfaces)
+ ifup_interfaces=${ifup_interfaces:-"wan lan wifi"}
+ for iface in $ifup_interfaces; do
+ ifup $iface
+ if [ "$iface" = "wifi" ]; then
+ $iface up
+ fi
+ done
+ ;;
esac
#!/bin/sh
server=$(nvram get ntp_server)
-case "$ACTION" in
+case "${ACTION:-ifup}" in
ifup)
- ps x | grep '[n]tpclient' >&- || {
+ ps x | grep 'bin/[n]tpclient' >&- || {
route -n 2>&- | grep '^0.0.0.0' >&- && /usr/sbin/ntpclient -c 1 -s -h ${server:-pool.ntp.org} &
}
;;
depends BR2_PACKAGE_OPENVPN
select BR2_PACKAGE_OPENSSL_UTIL
+config BR2_PACKAGE_OPENVPN_WEBIF
+ tristate "openvpn-webif - web interface module to configure OpenVPN (client mode)"
+ default m
+ depends BR2_PACKAGE_OPENVPN
+ select BR2_PACKAGE_WEBIF
+ help
+ Web interface module to configure and report status of OpenVPN (client
+ mode only)
+
config BR2_PACKAGE_OPENVPN_SERVER
bool "Enable server support"
default y
default y
depends BR2_PACKAGE_OPENPVN
+config BR2_PACKAG_OPENVPN_MANAGEMENT
+ bool "Enable PKCS12 management features"
+ default n
+ depends BR2_PACKAGE_OPENVPN
+
config BR2_PACKAGE_OPENVPN_SMALL
bool "Enable smaller executable size (disable OCC, usage message, and verb 4 parm list)"
default n
$(eval $(call PKG_template,OPENVPN,openvpn,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,OPENVPN_EASY_RSA,openvpn-easy-rsa,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENVPN_WEBIF,openvpn-webif,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
PKG_DEPEND:="kmod-tun"
ifneq ($(BR2_PACKAGE_OPENVPN_OPENSSL),y)
ifeq ($(BR2_PACKAGE_OPENVPN_SMALL),y)
ENABLE_SMALL:=--enable-small
endif
+ifneq ($(BR2_PACKAGE_OPENVPN_MANAGEMENT),y)
+DISABLE_SMALL:=--disable-management
+endif
$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
(cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
$(DISABLE_HTTP) \
$(ENABLE_PASSWORD_SAVE) \
$(ENABLE_SMALL) \
+ $(DISABLE_MANAGEMENT) \
);
touch $(PKG_BUILD_DIR)/.configured
install -m 0644 $(PKG_BUILD_DIR)/easy-rsa/2.0/openssl.cnf $(IDIR_OPENVPN_EASY_RSA)/etc/easy-rsa/openssl.cnf
install -m 0644 $(PKG_BUILD_DIR)/easy-rsa/2.0/vars $(IDIR_OPENVPN_EASY_RSA)/etc/easy-rsa/vars
$(IPKG_BUILD) $(IDIR_OPENVPN_EASY_RSA) $(PACKAGE_DIR)
+
+$(IPKG_OPENVPN_WEBIF):
+ install -d -m0755 $(IDIR_OPENVPN_WEBIF)/etc/init.d $(IDIR_OPENVPN_WEBIF)/www/cgi-bin/webif
+ install -m0755 ./files/S50openvpn $(IDIR_OPENVPN_WEBIF)/etc/init.d/S50openvpn
+ cp -fpR .files/openvpn{,-status}.sh $(IDIR_OPENVPN_WEBIF)/www/cgi-bin/webif/
+ $(IPKG_BUILD) $(IDIR_OPENVPN_WEBIF) $(PACKAGE_DIR)
Set => Paramètrer
Settings => Paramètres
Automatic WDS => WDS automatique
+WDS watchdog timeout => Délai d'inactivité WDS
+Antenna selection => Sélection de l'antenne
# "Hosts" page
FW_FILE_NEW="/tmp/.webif/file-firewall-new"
empty "$FORM_cancel" || {
+ empty "$FORM_delete_on_cancel" || {
+ awk \
+ -f - "$FW_FILE" > "$FW_FILE_NEW" <<EOF
+BEGIN {
+ first=1
+}
+{
+ if (first != 1) print old
+ old = \$0
+ first = 0
+}
+EOF
+ mv "$FW_FILE_NEW" "$FW_FILE"
+ }
FORM_save=""
FORM_edit=""
+ FORM_cancel=""
}
empty "$FORM_save" || {
-v del_layer7="$FORM_del_layer7" \
-v data_submit="$FORM_data_submit" \
-v new_match="$FORM_new_match" \
+ -v delete_on_cancel="$FORM_delete_on_cancel" \
-f /usr/lib/webif/common.awk \
-f /usr/lib/common.awk \
-f - "$FW_FILE" <<EOF
(\$1 == "drop") || (\$1 == "accept") || (\$1 == "forward" ) {
if (n == edit) {
- printf "<tr><td> </td><td>" button("save", "Save") button("cancel", "Cancel") "</td></tr>"
-
+ printf "<tr><td> </td><td>" button("save", "Save")
+ if( delete_on_cancel != "" ) print hidden("delete_on_cancel", 1);
+ print button("cancel", "Cancel")
+ print "</td></tr>"
print "</table>"
print "</td></tr>"
print "</form>"
print "<form method=\\"POST\\" action=\\"$SCRIPT_NAME\\" enctype=\\"multipart/form-data\\">"
print hidden("edit", n + 1);
print "<select name=\\"new_target\\">"
+ print hidden("delete_on_cancel", 1);
print sel_option("forward", "Forward")
print sel_option("accept", "Accept")
print sel_option("drop", "Drop")
1|on|enabled) FORM_lazywds=1;;
*) FORM_lazywds=0;;
esac
+ FORM_wdstimeout=${wl0_wdstimeout:-$(nvram get wl0_wdstimeout)}
+ FORM_antdiv="${wl0_antdiv:-$(nvram get wl0_antdiv)}"
+ case "$FORM_antdiv" in
+ -1|auto) FORM_antdiv=-1;;
+ 0|main|left) FORM_antdiv=0;;
+ 1|aux|right) FORM_antdiv=1;;
+ 3|diversity) FORM_antdiv=3;;
+ *) FORM_antdiv=-1;;
+ esac
+ FORM_distance="${wl0_distance:-$(nvram get wl0_distance)}"
else
SAVED=1
validate <<EOF
int|FORM_lazywds|Lazy WDS On/Off|required min=0 max=1|$FORM_lazywds
+int|FORM_wdstimeout|WDS watchdog timeout|optional min=0 max=3600|$FORM_wdstimeout
+int|FORM_distance|Distance|optional min=0 max=256|$FORM_distance
EOF
equal "$?" 0 && {
save_setting wireless wl0_lazywds "$FORM_lazywds"
+ save_setting wireless wl0_wdstimeout "$FORM_wdstimeout"
save_setting wireless wl0_macmode "$FORM_macmode"
+ save_setting wireless wl0_antdiv "$FORM_antdiv"
+ save_setting wireless wl0_distance "$FORM_distance"
}
fi
select|lazywds|$FORM_lazywds
option|1|@TR<<Enabled>>
option|0|@TR<<Disabled>>
+field|@TR<<WDS watchdog timeout>>
+text|wdstimeout|$FORM_wdstimeout
field|@TR<<Filter Mode>>:
select|macmode|$FORM_macmode
option|disabled|@TR<<Disabled>>
option|allow|@TR<<Allow>>
option|deny|@TR<<Deny>>
+field|@TR<<Antenna selection>>:
+select|antdiv|$FORM_antdiv
+option|-1|@TR<<Automatic>>
+option|0|@TR<<Left>>
+option|1|@TR<<Right>>
+option|3|@TR<<Diversity>>
+field|@TR<<Distance>>
+text|distance|$FORM_distance
end_form
EOF