Remove bash profile during installation script

This commit is contained in:
Manuel Thalmann 2024-12-08 04:46:53 +01:00
parent b61602cd68
commit b1ddb0de48

View file

@ -77,25 +77,34 @@ function runSetup
and runHook --force autologin "Please set up a function `autologin` for setting up autologin for the `root` user" and runHook --force autologin "Please set up a function `autologin` for setting up autologin for the `root` user"
and begin and begin
set -l script (string escape (getCloneFile (getInstallerScript))) set -l profile "/root/.bash_profile"
wrapScript ( begin
string join " " \ set -l profile (string escape "$profile")
(begin set -l tmp (string escape "$profile""_")
for var in \ set -l script (string escape (getCloneFile (getInstallerScript)))
CONFIG_NAME \
VALHALLA_BACKUP_DISABLED \
VALHALLA_BACKUP_DIR \
VALHALLA_BACKUP_SERVER \
VALHALLA_BACKUP_SERVER_PORT \
VALHALLA_BACKUP_SERVER_USER \
VALHALLA_BACKUP_SERVER_KEY
echo "$var=$(string escape "$$var")"
end
end) \
(string escape $script))
end | runChroot "$mountDir" tee /root/.bash_profile >/dev/null printf "%s\n" \
"mv $profile $tmp" \
(wrapScript (
string join " " \
(begin
for var in \
CONFIG_NAME \
VALHALLA_BACKUP_DISABLED \
VALHALLA_BACKUP_DIR \
VALHALLA_BACKUP_SERVER \
VALHALLA_BACKUP_SERVER_PORT \
VALHALLA_BACKUP_SERVER_USER \
VALHALLA_BACKUP_SERVER_KEY
echo "$var=$(string escape "$$var")"
end
end) \
(string escape $script) "&&")) \
"rm $tmp ||"
"mv $tmp $profile"
end | runChroot "$mountDir" tee "$profile" >/dev/null
end
end end
function actionPostRun function actionPostRun