Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/bin/bash
- # Check for root
- if [[ $EUID -ne 0 ]]; then
- echo "This script must be run as root"
- exit 1
- fi
- # Lets check if you are online
- wget -q --spider http://google.com
- if [ $? -eq 0 ]; then
- ONLINE=TRUE
- else
- ONLINE=FALSE
- fi
- if [ $ONLINE == "TRUE" ]; then
- echo "[+] We are going to update your pwnagotchi now"
- cd /home/pi/
- # Delete old files
- rm -rf pwnagotchi
- # Download the new files
- git clone https://github.com/evilsocket/pwnagotchi.git
- # Delete the old pwnagotchi files
- rm /root/pwnagotchi -rf
- # Main dir
- cd /home/pi/
- # Copy new files
- rsync -aP pwnagotchi/sdcard/rootfs/* /
- # Kill Screen session
- pkill screen
- # default is Alpha from the repo (Feel free to fix this)
- echo "pwnagotchi" > /etc/hostname
- echo "127.0.0.1 pwnagotchi" >> /etc/hosts
- echo "127.0.0.1 pwnagotchi.local" >> /etc/hosts
- # Restart screen session with new pwnagotchi
- sudo -H -u root /usr/bin/screen -dmS pwnagotchi -c /root/pwnagotchi/data/screenrc.auto
- echo "[+] Your pwnagotchi has been updated"
- else
- echo "WE ARE OFFLINE - LETS DO DIFFERNT SHIT"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement