Skip to content

Commit

Permalink
add systemd disable
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabriel committed Jul 16, 2024
1 parent 7bcfd56 commit 46151ed
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/config_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ function SystemdUnitSystemEnable() {
systemd_unit_system_enable+=($1)
}

function SystemdUnitSystemDisable() {
ValidateExactFunctionParams 1 $# $FUNCNAME

systemd_unit_system_disable+=($1)
}

function SystemdUnitUserEnable() {
ValidateExactFunctionParams 1 $# $FUNCNAME

Expand Down
9 changes: 9 additions & 0 deletions lib/handler_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ function HandleSystemdUnits() {
fi
}

function HandleSystemdUnitsDisable() {
for service in ${systemd_unit_system_disable[*]}; do
if systemctl is-enabled --quiet $service &>/dev/null; then
Info "Disabling systemmd system unit $service"
sudo systemctl disable $service
fi
done
}

function ParseChmod() {
local chmod=$1

Expand Down
1 change: 1 addition & 0 deletions lib/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ HandleUserDirectories
HandleUserDirectoriesFromTo

HandleSystemdUnits
HandleSystemdUnitsDisable

HandleSSHGenKeys
HandleSSHAddkeys
Expand Down

0 comments on commit 46151ed

Please sign in to comment.