fix(systemd): Run disables before enables

This commit is contained in:
zelikos 2023-09-15 14:11:06 -04:00
parent 7699cc919c
commit be8f58a035
No known key found for this signature in database
GPG key ID: AA0CB476ECFA09E7

View file

@ -9,22 +9,16 @@ get_yaml_array USER_ENABLED '.user.enabled[]' "$1"
get_yaml_array USER_DISABLED '.user.disabled[]' "$1"
if [[ ${#ENABLED[@]} -gt 0 ]]; then
for unit in "${ENABLED[@]}"; do
unit=$(printf "$unit")
systemctl enable $unit
done
fi
if [[ ${#DISABLED[@]} -gt 0 ]]; then
for unit in "${DISABLED[@]}"; do
unit=$(printf "$unit")
systemctl disable $unit
done
fi
if [[ ${#USER_ENABLED[@]} -gt 0 ]]; then
for unit in "${USER_ENABLED[@]}"; do
if [[ ${#ENABLED[@]} -gt 0 ]]; then
for unit in "${ENABLED[@]}"; do
unit=$(printf "$unit")
systemctl --user enable $unit
systemctl enable $unit
done
fi
if [[ ${#USER_DISABLED[@]} -gt 0 ]]; then
@ -33,3 +27,9 @@ if [[ ${#USER_DISABLED[@]} -gt 0 ]]; then
systemctl --user disable $unit
done
fi
if [[ ${#USER_ENABLED[@]} -gt 0 ]]; then
for unit in "${USER_ENABLED[@]}"; do
unit=$(printf "$unit")
systemctl --user enable $unit
done
fi