Skip to content

Commit ec6c8a4

Browse files
committed
installer: fix bugs in services menu
- all services were being removed because ignored services were only ignored in the menu - tr cannot take a file directly fixes: #393
1 parent 0b61788 commit ec6c8a4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

installer.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,10 @@ install_packages() {
12641264

12651265
menu_services() {
12661266
local sv _status _checklist=""
1267-
find $TARGETDIR/etc/runit/runsvdir/default -mindepth 1 -maxdepth 1 -xtype d -printf '%f\n' | sort -u > "$TARGET_SERVICES"
1267+
# filter out services that probably shouldn't be messed with
1268+
local sv_ignore='^(agetty-(tty[1-9]|generic|serial|console)|udevd|sulogin)$'
1269+
find $TARGETDIR/etc/runit/runsvdir/default -mindepth 1 -maxdepth 1 -xtype d -printf '%f\n' | \
1270+
grep -Ev "$sv_ignore" | sort -u > "$TARGET_SERVICES"
12681271
while true; do
12691272
while read -r sv; do
12701273
if [ -n "$sv" ]; then
@@ -1275,16 +1278,13 @@ menu_services() {
12751278
fi
12761279
_checklist+=" ${sv} ${sv} ${_status}"
12771280
fi
1278-
done < <(find $TARGETDIR/etc/sv -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | \
1279-
# filter out services that probably shouldn't be messed with
1280-
grep -Ev '^(agetty-(tty[1-9]|generic|serial)|udevd|sulogin)$' | sort -u)
1281-
echo "$_checklist" 1>&2
1281+
done < <(find $TARGETDIR/etc/sv -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | grep -Ev "$sv_ignore" | sort -u)
12821282
DIALOG --no-tags --checklist "Select services to enable:" 20 60 18 ${_checklist}
12831283
if [ $? -eq 0 ]; then
1284-
comm -13 "$TARGET_SERVICES" <(tr ' ' '\n' "$ANSWER") | while read -r sv; do
1284+
comm -13 "$TARGET_SERVICES" <(cat "$ANSWER" | tr ' ' '\n') | while read -r sv; do
12851285
enable_service "$sv"
12861286
done
1287-
comm -23 "$TARGET_SERVICES" <(tr ' ' '\n' "$ANSWER") | while read -r sv; do
1287+
comm -23 "$TARGET_SERVICES" <(cat "$ANSWER" | tr ' ' '\n') | while read -r sv; do
12881288
disable_service "$sv"
12891289
done
12901290
break

0 commit comments

Comments
 (0)