Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Code:
Selected Language:
Show Linenumbers:
Short link for Twitter:
HTML:

HTML view:

Copy Source | Copy HTML
  1. #!/bin/bash
  2. PWR=$(cat /sys/class/rfkill/rfkill0/state)
  3.  
  4. case $1 in
  5.     poweron)
  6.         if [[ "$PWR" = "0" ]]; then
  7.             echo 1 > /sys/class/rfkill/rfkill0/state
  8.                 sleep 1
  9.         fi
  10.         ;;
  11.  
  12.     poweroff)
  13.         if [[ "$PWR" = "1" ]]; then
  14.             ifconfig wlan0 down
  15.             sleep 1
  16.             echo 0 > /sys/class/rfkill/rfkill0/state
  17.         fi
  18.         ;;
  19. esac




Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2017