From d3cc957d3b06becd88a1be6f455e0eefec36ea1f Mon Sep 17 00:00:00 2001 From: Party Wumpus <48649272+PartyWumpus@users.noreply.github.com> Date: Tue, 10 Jan 2023 17:19:30 +0000 Subject: Switch to bash instead of sh --- user_install_script.sh | 11 +++++------ 1 file 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 -- cgit v1.2.3