####Pwny restart scripts to recover from Go crashes in bettercap ####These issue are in ALL builds of bettercap ########################################## ##########pwny restart script 1 ########## ###### pwny-restart.sh sudo nano /root/pwny-restart.sh ######### copy form here #!/bin/bash # Define the search string SEARCH_STRING="fatal error: concurrent map iteration and map write" # Continuously monitor syslog for the search string tail -f /var/log/syslog | while read line do if echo "$line" | grep -q "$SEARCH_STRING"; then # If the string is found, execute a command echo "Found the search string in syslog, executing command..." # Insert your command here: sleep 10 && sudo systemctl restart bettercap pwngrid-peer && touch /root/.pwnagotchi-auto && systemctl restart pwnagotchi fi done ######to here ########## service to run pwny-restart sudo nano /etc/systemd/system/pwny-restart.service ####### copy from here [Unit] Description=Search syslog for Go map crash [Service] ExecStart=/root/pwny-restart.sh [Install] WantedBy=multi-user.target ###### to here #############Script 2 ##################### ###### pwny-restart2.sh ################### sudo nano /root/pwny-restart2.sh ################Copy from here ###### #!/bin/bash # Define the search string SEARCH_STRING="panic: runtime error" # Continuously monitor syslog for the search string tail -f /var/log/syslog | while read line do if echo "$line" | grep -q "$SEARCH_STRING"; then # If the string is found, execute a command echo "Found the search string in syslog, executing command..." # Insert your command here: sleep 10 && sudo systemctl restart bettercap pwngrid-peer && touch /root/.pwnagotchi-auto && systemctl restart pwnagotchi fi done ######### to here######## ########## service to run pwny-restart2 sudo nano /etc/systemd/system/pwny-restart2.service #######copy from here [Unit] Description=Search syslog for Go panic [Service] ExecStart=/root/pwny-restart2.sh [Install] WantedBy=multi-user.target ####### to here ############################ chmod +x /root/pwny-restart.sh chmod +x /root/pwny-restart2.sh sudo systemctl enable pwny-restart pwny-restart2 sudo systemctl start pwny-restart pwny-restart2