services: optimize loop

No use to distinguish between "on" and "off"
each iteration when the resulting files with
differing names should end up identical.
This commit is contained in:
Michael Shigorin 2016-10-17 15:56:36 +03:00
parent 572ba27759
commit 0112879c29

View File

@ -33,19 +33,11 @@ for i in $SERVICES; do
onoff="$(shell_config_get "$STATUS" "$i")"
[ -n "$onoff" ] || continue
echo "$i" >> /usr/share/install2/services-"$onoff"
# create systemd-specific hooks
case "$onoff" in
on)
action=enabled;;
off)
action=disabled;;
*)
continue;;
esac
echo "$i" >> /usr/share/install2/systemd-"$action"
done
cp -a /usr/share/install2/{services-on,systemd-enabled}
cp -a /usr/share/install2/{services-off,systemd-disabled}
rm "$STATUS"
: