Advertisement
rhcp011235

Untitled

Oct 2nd, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.09 KB | None | 0 0
  1. #/bin/bash
  2.  
  3. # Check for root
  4. if [[ $EUID -ne 0 ]]; then
  5.    echo "This script must be run as root"
  6.    exit 1
  7. fi
  8.  
  9. # Lets check if you are online
  10. wget -q --spider http://google.com
  11.  
  12. if [ $? -eq 0 ]; then
  13.     ONLINE=TRUE
  14. else
  15.     ONLINE=FALSE
  16. fi
  17.  
  18. if [ $ONLINE == "TRUE" ]; then
  19.     echo "[+] We are going to update your pwnagotchi now"
  20.     cd /home/pi/
  21.  
  22.     # Delete old files
  23.     rm -rf pwnagotchi
  24.  
  25.     # Download the new files
  26.     git clone https://github.com/evilsocket/pwnagotchi.git
  27.  
  28.     # Delete the old pwnagotchi files
  29.     rm /root/pwnagotchi -rf
  30.  
  31.     # Main dir
  32.     cd /home/pi/
  33.  
  34.     # Copy new files
  35.     rsync -aP pwnagotchi/sdcard/rootfs/* /
  36.  
  37.     # Kill Screen session
  38.     pkill screen
  39.  
  40.     # default is Alpha from the repo (Feel free to fix this)
  41.     echo "pwnagotchi" > /etc/hostname
  42.     echo "127.0.0.1 pwnagotchi" >> /etc/hosts
  43.     echo "127.0.0.1 pwnagotchi.local" >> /etc/hosts
  44.  
  45.     # Restart screen session with new pwnagotchi
  46.     sudo -H -u root /usr/bin/screen -dmS pwnagotchi -c /root/pwnagotchi/data/screenrc.auto
  47.     echo "[+] Your pwnagotchi has been updated"
  48. else
  49.     echo "WE ARE OFFLINE - LETS DO DIFFERNT SHIT"
  50. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement