NoPaste Service
DOWNLOAD
Language: Bash
Author: Matrix86
Description: rftoggle
Date: 13/12/10 00:57
  1. #!/bin/bash
  2.  
  3. blocked=`/usr/sbin/rfkill list wlan | grep "Soft blocked: yes"`
  4. user=`ps aux | grep knotify4 | grep -v grep | cut  -d " " -f1`
  5.  
  6.  
  7. if [ -z "$blocked" ]; then
  8.    /usr/sbin/rfkill block wlan
  9.    /usr/sbin/rfkill block bluetooth
  10.    sudo -u $user notify-send 'Wireless and Bluetooth' 'Periferiche Wireless e Bluetooth disattivate.' -t 1500
  11. else
  12.    /usr/sbin/rfkill unblock wlan
  13.    /usr/sbin/rfkill unblock bluetooth
  14.    sudo -u $user notify-send 'Wireless and Bluetooth' 'Periferiche Wireless e Bluetooth attive.' -t 1500
  15. fi