123456789101112131415161718192021222324252627282930 |
- #Notify user of interface state changes
- display_notice()
- {
- export DISPLAY=:0
- export TEXTDOMAIN=dhcpcd_notify
- export OUTPUT_CHARSET=UTF-8
- . gettext.sh
- case "$reason" in
- BOUND|REBOOT|STATIC) #up
- gtkdialog-splash -placement bottom -timeout 4 -bg green -text "`eval_gettext \"\\\$new_ip_address acquired on \\\$interface\"`" ;;
- CARRIER) #ifup
- ssid="$(wpa_cli -i $interface status 2>/dev/null | grep ^ssid | cut -f 2 -d =)"
- gtkdialog-splash -placement bottom-left -timeout 4 -bg orange -text "`eval_gettext \"Requesting IP address for \\\$interface \\\$ssid\"`" &
- ;;
- RELEASE) #release
- gtkdialog-splash -placement bottom -timeout 4 -bg orange -text "`eval_gettext \"Releasing \\\$interface\"`" ;;
- NOCARRIER) #down
- gtkdialog-splash -placement bottom -timeout 4 -bg hotpink -text "`eval_gettext \"\\\$interface is down\"`" ;;
- IPV4LL|TIMEOUT|FAIL) #timeout
- gtkdialog-splash -placement bottom -timeout 4 -bg red -text "`eval_gettext \"IP address request failed on \\\$interface\"`" ;;
- esac
- }
- if echo "$reason" | grep -q -E 'BOUND|REBOOT|STATIC|CARRIER|RELEASE|NOCARRIER|IPV4LL|TIMEOUT|FAIL';then
- [ -f /etc/dhcpcd_state_notify ] && display_notice
- fi
|