/ remove comments from services.txt

This commit is contained in:
committer@tuxwarrior
2025-04-19 15:23:13 -05:00
parent c20782638b
commit a791a07f76

View File

@@ -155,22 +155,13 @@ do_services() {
exit 1
fi
mapfile -t services < ${trg_file}
echo "::: ${services[@]}"
# remove comments
sed '/^[[:blank:]]*#/d;s/#.*//' ${trg_file} > ${trg_file}.tmp
mapfile -t services < ${trg_file}.tmp
for x in ${services[@]}; do
echo ">>> ${x}"
if [[ "${x}" =~ ^#.* ]]; then
echo "skipping comment ${x}"
continue
fi
echo "systemctl enable ${x}"
# systemctl enable ${x}
systemctl enable ${x}
done
}