Switch from $SUDO to $ESCALATE
Support both `doas` and `sudo`.
This commit is contained in:
parent
3614c24cf4
commit
706d1359c1
@ -8,8 +8,6 @@ AUTO_UPDATER_ENABLED=${1:-false}
|
||||
DISABLE_TUI=${2:-false}
|
||||
INIT=${3:-false}
|
||||
|
||||
SUDO=${CH_SUDO:-sudo}
|
||||
|
||||
set -e
|
||||
|
||||
configfile="./scripts/updater-preferences"
|
||||
@ -152,7 +150,7 @@ function performupdate() {
|
||||
pushd build && cmake .. && cmake --build . --target cathook -- -j$proccount || { echo -e "\033[1;31m \n \nFailed to compile cathook\n\033[0m"; exit 1; }
|
||||
# Update data
|
||||
cwd="$(pwd)"
|
||||
cmake --build . --target data || { echo -e "\033[1;31m\nFailed to update /opt/cathook/data directory! Trying with root rights!\n\033[0m"; $SUDO bash -c "cd \"$cwd\"; cmake --build . --target data" || { echo -e "\033[1;31m\nFailed to update /opt/cathook/data directory\n\033[0m"; exit 1; } }
|
||||
cmake --build . --target data || { echo -e "\033[1;31m\nFailed to update /opt/cathook/data directory! Trying with root rights!\n\033[0m"; $ESCALATE bash -c "cd \"$cwd\"; cmake --build . --target data" || { echo -e "\033[1;31m\nFailed to update /opt/cathook/data directory\n\033[0m"; exit 1; } }
|
||||
popd
|
||||
echo -e "\n\033[1;34mCathook updated successfully\n\033[0m"
|
||||
rm -f ${LOCKFILE}
|
||||
|
Reference in New Issue
Block a user