From 0112879c2952aae70cd4ae3a97f68b89fcb26222 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Mon, 17 Oct 2016 15:56:36 +0300 Subject: [PATCH] services: optimize loop No use to distinguish between "on" and "off" each iteration when the resulting files with differing names should end up identical. --- .../services/install2/image-scripts.d/10-services | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/features.in/services/install2/image-scripts.d/10-services b/features.in/services/install2/image-scripts.d/10-services index b8bc5e06..27db5556 100755 --- a/features.in/services/install2/image-scripts.d/10-services +++ b/features.in/services/install2/image-scripts.d/10-services @@ -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" :