stooged / PI-Pwn

pppwn
447 stars 83 forks source link

[Feature] : Add another service which will monitor PS4 is turned off or not, and enable Jailbreaking, even if PI is running #48

Closed Curiosity007 closed 4 months ago

Curiosity007 commented 4 months ago

My PS4 slim had very low power from its usb ports, so I had to keep the pi running from another power source. What I noticed, if PI has ppwned console once, it will not again try to jailbreak it, unless the PI service is restarted. So, created a small utility which will do this, and thereby separating out PS4 shutdown and PI shutdown.

  1. Create a Shell Script: Write a script that tails the journalctl logs and checks for the specified line. If the line is found, the script will restart the service.

    #!/bin/bash
    
    journalctl -fu pipwn | while read line
    do
     echo $line | grep "/usr/sbin/pppoe -n -I eth0 -e" &> /dev/null
     if [ $? -eq 0 ]; then
       echo "Restarting pipwn service..."
       systemctl restart pipwn
     fi
    done
    • Save this script in a file, for example, /usr/local/bin/check_and_restart.sh.
    • Make sure the script is executable: chmod +x /usr/local/bin/check_and_restart.sh.
  2. Create a systemd Service: Create a systemd service that runs this script.

    Create a systemd service file at /etc/systemd/system/pipwn_monitor.service:

    [Unit]
    Description=Monitor journalctl for pipwn and restart if needed
    
    [Service]
    ExecStart=/usr/local/bin/check_and_restart.sh
    Restart=always
    User=root
    
    [Install]
    WantedBy=multi-user.target

    Enable and start the service:

    systemctl enable pipwn_monitor.service
    systemctl start pipwn_monitor.service
  3. Monitoring and logs: You can monitor the logs of your script using:

    journalctl -fu pipwn_monitor.service
Doyle4 commented 4 months ago

You can bypass the Pi's input power, I put a USB C breakout port to my Pi3B+ direct to 5v in bypassing voltage/current protection, this allows the Pi to use full power the PS4 USBs can deliver. PS4 USB's are maxed out between 900-950mah.