14 lines
602 B
Bash
14 lines
602 B
Bash
#!/bin/sh
|
|||
|
|
# NetworkManager dispatcher: replace sxmo_networkmonitor's long-lived
|
||
|
|
# "nmcli device monitor" with event-driven Sxmo network/statusbar hooks.
|
||
|
|
# The helper re-executes as the X session user so status files stay owned by
|
||
|
|
# user:user. Double-fork so NetworkManager never waits for shell hooks.
|
||
|
|
case "${2:-}" in
|
||
|
|
up|down|pre-up|pre-down|vpn-up|vpn-down|vpn-pre-up|vpn-pre-down|\
|
||
|
|
connectivity-change|dhcp4-change|dhcp6-change|dns-change) ;;
|
||
|
|
*) exit 0 ;;
|
||
|
|
esac
|
||
|
|
( su user -s /bin/sh -c \
|
||
|
|
"/usr/bin/bananarchy-network-event.sh '$1' '$2'" \
|
||
|
|
>/dev/null 2>&1 & ) 2>/dev/null || true
|
||
|
|
exit 0
|