We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df21128 commit 7d7cfe9Copy full SHA for 7d7cfe9
modules/share/airootfs.any/root/functions.sh
@@ -94,7 +94,13 @@ _safe_systemctl(){
94
for _service in "${@}"; do
95
# https://unix.stackexchange.com/questions/539147/systemctl-check-if-a-unit-service-or-target-exists
96
if (( "$(systemctl list-unit-files "${_service}" | wc -l)" > 3 )); then
97
- systemctl "${_command}" "${_service}"
+ if [[ "${_command}" = "enable" ]]; then
98
+ if [[ "$(systemctl is-enabled "${_service}")" = "enabled" ]]; then
99
+ systemctl enable "${_service}"
100
+ fi
101
+ else
102
+ systemctl "${_command}" "${_service}"
103
104
else
105
echo "${_service} was not found" >&2
106
fi
0 commit comments