We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff2a444 commit c594fc9Copy full SHA for c594fc9
1 file changed
modules/share/airootfs.any/root/functions.sh
@@ -95,10 +95,10 @@ _safe_systemctl(){
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
if [[ "${_command}" = "enable" ]]; then
98
- if [[ "$(systemctl is-enabled "${_service}")" = "disabled" ]]; then
99
- systemctl enable "${_service}"
100
- else
+ if [[ "$(systemctl is-enabled "${_service}")" = "enabled" ]]; then
101
echo "${_service} has been enabled" >&2
+ else
+ systemctl enable "${_service}" || true
102
fi
103
else
104
systemctl "${_command}" "${_service}"
0 commit comments