Skip to content
Snippets Groups Projects
Commit 1d95b20b authored by Jan Hohmann's avatar Jan Hohmann Committed by Jouke Witteveen
Browse files

Support rfkill for mobile_ppp connections

parent 4d424c7b
No related branches found
No related tags found
No related merge requests found
...@@ -480,6 +480,11 @@ type: ...@@ -480,6 +480,11 @@ type:
'OptionsFile=':: 'OptionsFile='::
A file to read additional pppd options from. A file to read additional pppd options from.
'RFKill='::
The name of an *rfkill* device. When specified, the device is used
to block/unblock the interface when appropriate. Names can be found
in '/sys/class/rfkill/rfkillX/name'.
OPTIONS FOR `openvswitch' CONNECTIONS OPTIONS FOR `openvswitch' CONNECTIONS
------------------------------------- -------------------------------------
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
# Based on Thomas Bächler’s <thomas@archlinux.org> pppoe script # Based on Thomas Bächler’s <thomas@archlinux.org> pppoe script
# Also see <https://wiki.archlinux.org/index.php/3G_and_GPRS_modems_with_pppd> for more information. # Also see <https://wiki.archlinux.org/index.php/3G_and_GPRS_modems_with_pppd> for more information.
. "$SUBR_DIR/rfkill"
: ${PPPD:=pppd} : ${PPPD:=pppd}
: ${InterfaceRoot=dev/} : ${InterfaceRoot=dev/}
...@@ -13,6 +15,10 @@ quote_word() { ...@@ -13,6 +15,10 @@ quote_word() {
mobile_ppp_up() { mobile_ppp_up() {
local options_dir="$STATE_DIR/mobile_ppp-$Interface-$Profile" local options_dir="$STATE_DIR/mobile_ppp-$Interface-$Profile"
if [[ $RFKill ]]; then
rf_enable "$Interface" "$RFKill" || return 1
fi
network_ready network_ready
mkdir -p "$options_dir" mkdir -p "$options_dir"
...@@ -97,6 +103,9 @@ mobile_ppp_down() { ...@@ -97,6 +103,9 @@ mobile_ppp_down() {
fi fi
rm -r "$options_dir" rm -r "$options_dir"
if [[ $RFKill ]]; then
rf_disable "$Interface" "$RFKill"
fi
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment