Advertisement
Dj_Dexter

wifibar

Sep 26th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.74 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. echo -n "Nombre de la tarjeta de red: "
  4. read tarjeta
  5.  
  6. while [ 1 ]
  7. do
  8.     fecha=$(date +"%d/%B - %H:%M:%S")
  9.     uptime=$(uptime | cut -d ',' -f 1 | grep -o 'up.*')
  10.     essid=$(/sbin/iwgetid $tarjeta -r)
  11.         AP="`/sbin/iwgetid --raw --ap | cut -c1-8`"
  12.         SENAL="`/sbin/iwconfig 2> /dev/null | sed -n "/${tarjeta}/{n;n;n;n;n;p;}" | awk -F'=' '{printf $NF}' | sed 's/\s//g'`"
  13.     essiddatos=$(/sbin/iwconfig $tarjeta 2> /dev/null | sed -E '/Bit Rate/!d;s/ //g;s/BitRate=(.*)Tx-Power=(.*)dBm/\2dBm BitRate:\1/g')
  14.         BITR="`/sbin/iwconfig 2> /dev/null | sed -n "/${tarjeta}/{n;n;p;}" | sed -E 's/^[^=]+=([.0-9]+)\s.*/\1Mb\/s/'`"
  15.     xsetroot -name "[ESSID:$essid $SENAL $AP $BITR ] {$fecha} [$uptime] $(id -un)@$(hostname)"
  16.     sleep 5s
  17. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement