Opennet Firmware
on-captive-portal-hotplug.sh
gehe zur Dokumentation dieser Datei
1 #!/bin/sh
2 #
3 # Aktiviere/deaktiviere das hotspot-Netzwerk-Interface je nach Verfügbarkeit des Opennet-VPN-Tunnels.
4 #
5 
6 # wir verwenden explizit eine sub-Shell um Seiteneffekte für andere hotplug-Skripte zu vermeiden
7 process_captive_portal_triggers() {
8  # shellcheck source=opennet/packages/on-core/files/usr/lib/opennet/on-helper.sh
9  . "${IPKG_INSTROOT:-}/usr/lib/opennet/on-helper.sh"
10 
11  # das Opennet-VPN-Interface triggert die Aktivierung/Deaktivierung des hotspot-Interface
12  if [ "$INTERFACE" = "$NETWORK_TUNNEL" ]; then
13  msg_info "Trigger activation of Captive Portal interface following the state of the VPN tunnel"
14  echo "on-function sync_captive_portal_state_with_mig_connections" | schedule_task
15  fi
16 }
17 
18 if [ "$ACTION" = "ifup" ] || [ "$ACTION" = "ifdown" ]; then
19  if on-function is_on_module_installed_and_enabled "on-captive-portal"; then
20  process_captive_portal_triggers
21  fi
22 fi
msg_info(message)
Informationen und Fehlermeldungen ins syslog schreiben.
Definition: core.sh:15
is_on_module_installed_and_enabled(module)
Pruefe ob ein Modul sowohl installiert, als auch aktiv ist.
Definition: modules.sh:9