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