Redirect variables during process elevation

This commit is contained in:
Manuel Thalmann 2023-04-01 17:53:27 +02:00
parent d3cae1a4c8
commit afdc301ad9
2 changed files with 2 additions and 2 deletions

View file

@ -4,7 +4,7 @@ NEXTCLOUD_DIR="${NEXTCLOUD_DIR}";
# Elevate script
if [ ! "$UID" -eq 0 ]
then
sudo bash "$BASH_SOURCE" "$USER";
NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" sudo bash "$BASH_SOURCE" "$USER";
else
homeDir="$(sudo -u "$1" bash -c 'realpath ~')";
fontFileBaseName="Caskaydia Cove Regular Nerd Font Complete.otf";

View file

@ -4,7 +4,7 @@ NEXTCLOUD_DIR="${NEXTCLOUD_DIR}";
# Elevate script
if [ ! "$UID" -eq 0 ]
then
sudo bash "$BASH_SOURCE" "$USER";
NEXTCLOUD_DIR="${NEXTCLOUD_DIR}" sudo bash "$BASH_SOURCE" "$USER";
else
bin=oh-my-posh;
contextRoot="$(mktemp -d)";