Commit 1d95b20b authored by Jan Hohmann's avatar Jan Hohmann Committed by Jouke Witteveen
Browse files

Support rfkill for mobile_ppp connections

parent 4d424c7b
......@@ -480,6 +480,11 @@ type:
'OptionsFile='::
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
-------------------------------------
......
......@@ -2,6 +2,8 @@
# 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.
. "$SUBR_DIR/rfkill"
: ${PPPD:=pppd}
: ${InterfaceRoot=dev/}
......@@ -13,6 +15,10 @@ quote_word() {
mobile_ppp_up() {
local options_dir="$STATE_DIR/mobile_ppp-$Interface-$Profile"
if [[ $RFKill ]]; then
rf_enable "$Interface" "$RFKill" || return 1
fi
network_ready
mkdir -p "$options_dir"
......@@ -97,6 +103,9 @@ mobile_ppp_down() {
fi
rm -r "$options_dir"
if [[ $RFKill ]]; then
rf_disable "$Interface" "$RFKill"
fi
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment