summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorTrainDoctor <11465594+TrainDoctor@users.noreply.github.com>2022-07-02 14:42:41 -0700
committerTrainDoctor <11465594+TrainDoctor@users.noreply.github.com>2022-07-02 14:42:41 -0700
commitb7d57de3781a95b5046e678a4ec259a4b0d80910 (patch)
tree6f9cf57ad3742b22833883d38fcb6704e39e827b /dist
parentee8aa98446773a617e70b8fd793a1d81a1d33472 (diff)
downloaddecky-loader-b7d57de3781a95b5046e678a4ec259a4b0d80910.tar.gz
decky-loader-b7d57de3781a95b5046e678a4ec259a4b0d80910.zip
Add pre-release install script
Diffstat (limited to 'dist')
-rwxr-xr-xdist/install_prerelease.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/dist/install_prerelease.sh b/dist/install_prerelease.sh
new file mode 100755
index 00000000..1b1c8f79
--- /dev/null
+++ b/dist/install_prerelease.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+[ "$UID" -eq 0 ] || exec sudo "$0" "$@"
+
+echo "Installing Steam Deck Plugin Loader release..."
+
+HOMEBREW_FOLDER=/home/deck/homebrew
+
+# # Create folder structure
+rm -rf ${HOMEBREW_FOLDER}/services
+sudo -u deck mkdir -p ${HOMEBREW_FOLDER}/services
+sudo -u deck mkdir -p ${HOMEBREW_FOLDER}/plugins
+
+# Download latest release and install it
+DOWNLOADURL="$(curl -s 'https://api.github.com/repos/SteamDeckHomebrew/PluginLoader/releases' | jq -r "first(.[] | select(.prerelease == "true"))" | jq -r ".assets[].browser_download_url")"
+# printf "DOWNLOADURL=$DOWNLOADURL\n"
+curl -L $DOWNLOADURL --output ${HOMEBREW_FOLDER}/services/PluginLoader
+chmod +x ${HOMEBREW_FOLDER}/services/PluginLoader
+
+systemctl --user stop plugin_loader 2> /dev/null
+systemctl --user disable plugin_loader 2> /dev/null
+
+systemctl stop plugin_loader 2> /dev/null
+systemctl disable plugin_loader 2> /dev/null
+rm -f /etc/systemd/system/plugin_loader.service
+cat > /etc/systemd/system/plugin_loader.service <<- EOM
+[Unit]
+Description=SteamDeck Plugin Loader
+[Service]
+Type=simple
+User=root
+Restart=always
+ExecStart=/home/deck/homebrew/services/PluginLoader
+WorkingDirectory=/home/deck/homebrew/services
+Environment=PLUGIN_PATH=/home/deck/homebrew/plugins
+[Install]
+WantedBy=multi-user.target
+EOM
+systemctl daemon-reload
+systemctl start plugin_loader
+systemctl enable plugin_loader