Add a variable storing the sudoers config file name

This commit is contained in:
Manuel Thalmann 2024-03-24 13:09:21 +01:00
parent b1565daf3f
commit c2df03ce2d

View file

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
rootDir="${BASH_SOURCE%/*}"; rootDir="${BASH_SOURCE%/*}";
customPortValhallaSudoConfigFile="/etc/sudoers.d/1337_PortValhalla"
pushd "$rootDir" > /dev/null; pushd "$rootDir" > /dev/null;
. "../../Common/Scripts/hooks.sh"; . "../../Common/Scripts/hooks.sh";
@ -7,7 +8,7 @@ pushd "$rootDir" > /dev/null;
function autoRoot() { function autoRoot() {
{ {
echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL"
} | sudo tee "/etc/sudoers.d/PortValhalla" > /dev/null; } | sudo tee "$customPortValhallaSudoConfigFile" > /dev/null;
} }
runHook initialize \ runHook initialize \
@ -32,6 +33,6 @@ runHook initializeProfile \
. "$(pwd)/../../../scripts/Common/Config/UserProfile/install.sh"; . "$(pwd)/../../../scripts/Common/Config/UserProfile/install.sh";
runHook postInstall \ runHook postInstall \
sudo rm "/etc/sudoers.d/PortValhalla"; sudo rm "$customPortValhallaSudoConfigFile";
popd > /dev/null; popd > /dev/null;