-
-
Save e-minguez/fd9f96544bee030d979b6ed9c442fbce to your computer and use it in GitHub Desktop.
ps4 remote shutdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies: | |
https://www.npmjs.com/package/ps4-waker | |
jq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ps4-waker check; | |
waker_state=$?; | |
if [ $waker_state -eq 2 ] | |
then | |
echo "It already in shutdown state"; | |
exit 0; | |
else | |
if [ $waker_state -eq 1 ] | |
then | |
echo "It in rest state, need to wake it"; | |
ps4-waker; | |
fi | |
fi | |
JSON=$(ps4-waker check); | |
RUNNING=$(echo $JSON | jq '."running-app-name"') | |
if [ -z "$RUNNING" ] || [ "$RUNNING" = "null" ] | |
then | |
echo "No running game"; | |
else | |
echo "Running game, need to close it" | |
ps4-waker remote ps ps:2000 left left up up up up up up up up up up up up enter enter; | |
fi; | |
sleep 5; | |
echo "Now will try to shutdown it"; | |
ps4-waker remote ps ps:2000 left left up up up up up up up up up up up up down down enter up up up up down down down enter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment