Commit db8e5121 authored by Bernhard Landauer's avatar Bernhard Landauer
Browse files

fix enable systemd services

parent c74d65fc
......@@ -31,12 +31,12 @@ setup_profiles() {
enable_services() {
# Enable services in the chosen profile
echo "Enabling services"
eval $(grep -e "enable_systemd=" $profile | sed 's/# //g')
echo "${^enable_systemd[@]}" | xargs -n1 > /tmp/.services
echo /mnt/usr/lib/systemd/system/* | xargs -n1 | cut -d/ -f7 | sed 's/.service//g' > /tmp/.available_services
grep -f /tmp/.available_services /tmp/.services > /tmp/.fix && mv /tmp/.fix /tmp/.services
source $profile
[[ -z ${enable_systemd} ]] && \
enable_systemd=('avahi-daemon' 'bluetooth' 'cronie' 'ModemManager' 'NetworkManager' 'org.cups.cupsd' 'tlp' 'haveged' 'ufw' 'apparmor' 'snapd.apparmor' 'snapd' 'fstrim.timer')
echo "${enable_systemd[@]}" | xargs -n1 > /tmp/.services
for service in $(cat /tmp/.services); do
if [[ -e /mnt/usr/lib/systemd/system/$service ]]; then
if [[ -e "/mnt/usr/lib/systemd/system/$service.service" ]]; then
arch_chroot "systemctl enable $service" 2>$ERR && echo "enabled service $service"
fi
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment