rhcp011235 icon

Untitled

rhcp011235 | PRO | 10/02/19 06:45:35 AM UTC | 0 ⭐ | 567 👁️ | Never ⏰ | []
Bash |

1.09 KB

|

None

|

0 👍

/

0 👎

#/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

Comments