summaryrefslogtreecommitdiff
path: root/configs/profile/root-image/root/.session/install/chroot-services.sh
blob: a63963e1b013583c8d2c7d01fb7fa337702c691b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

source /root/session-common.sh.inc


Init=$(GetStateVar 'INIT')
Wmde=$(GetStateVar 'WMDE')
if   [[ "${Init}" == 'openrc' ]]
then # Create the dbus user if it doesn't exist
     grep dbus /etc/group  > /dev/null || groupadd -g 81 dbus
     grep dbus /etc/passwd > /dev/null || useradd  -g 81 -u 81 dbus -r -s /sbin/nologin

     # Enable services with OpenRC
     rc-update add alsasound      default
     rc-update add dbus           default
     rc-update add NetworkManager default
elif [[ "${Init}" == 'systemd' ]]
     case "${Wmde}" in
     'lxde') systemctl enable 'NetworkManager.service' 'lxdm.service'     ;;
     'mate') systemctl enable 'NetworkManager.service' 'lightdm.service'  ;;
     *     ) systemctl enable 'dhcpcd.service' 'systemd-resolved.service' ;;
     esac
fi