diff options
| author | Party Wumpus <48649272+PartyWumpus@users.noreply.github.com> | 2023-01-10 17:19:30 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-10 17:19:30 +0000 |
| commit | d3cc957d3b06becd88a1be6f455e0eefec36ea1f (patch) | |
| tree | 1fd9c0acc29051cab7011168a1c695d6bd1e3166 | |
| parent | c09692f5ae81aa69301ca94bc61985ddaa49bc6c (diff) | |
| download | decky-installer-d3cc957d3b06becd88a1be6f455e0eefec36ea1f.tar.gz decky-installer-d3cc957d3b06becd88a1be6f455e0eefec36ea1f.zip | |
Switch to bash instead of sh
| -rw-r--r-- | user_install_script.sh | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/user_install_script.sh b/user_install_script.sh index 8dee397..47460c8 100644 --- a/user_install_script.sh +++ b/user_install_script.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # if a password was set by decky, this will run when the program closes temp_pass_cleanup() { @@ -39,15 +39,14 @@ if (( $EUID != 0 )); then fi # get user dir before rerunning as root, otherwise it'll just be 'home/root' - USER_DIR="$(getent passwd $USER | cut -d: -f6)" - HOMEBREW_FOLDER="${USER_DIR}/homebrew" - echo "$PASS" | sudo -S -k sh "$0" "$USER_DIR" "$HOMEBREW_FOLDER" # rerun script as root + + echo "$PASS" | sudo -S -k bash "$0" "$@" # rerun script as root exit 1 fi # all code below should be run as root -USER_DIR=$1 -HOMEBREW_FOLDER=$2 +USER_DIR="$(getent passwd $SUDO_USER | cut -d: -f6)" +HOMEBREW_FOLDER="${USER_DIR}/homebrew" # if decky is already installed, then also add an 'uninstall' prompt if [[ -f "${USER_DIR}/homebrew/services/PluginLoader" ]] ; then |
