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 begin
set -l script (string escape (getCloneFile (getInstallerScript)))
set -l profile "/root/.bash_profile"
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))
begin
set -l profile (string escape "$profile")
set -l tmp (string escape "$profile""_")
set -l script (string escape (getCloneFile (getInstallerScript)))
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
function actionPostRun