You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

88 lines
2.8 KiB

#!/bin/sh -e
# Only needed for s6 and suite66.
s6_enable_live_services(){
if [ -d /etc/s6/sv/gdm/dependencies.d ]; then
touch /etc/s6/sv/gdm/dependencies.d/artix-live
fi
if [ -d /etc/s6/sv/lightdm-srv/dependencies.d ]; then
touch /etc/s6/sv/lightdm-srv/dependencies.d/artix-live
fi
if [ -d /etc/s6/sv/sddm/dependencies.d ]; then
touch /etc/s6/sv/sddm/dependencies.d/artix-live
fi
}
s6_disable_live_services(){
rm -f /etc/s6/sv/gdm/dependencies.d/artix-live
rm -f /etc/s6/sv/lightdm-srv/dependencies.d/artix-live
rm -f /etc/s6/sv/sddm/dependencies.d/artix-live
}
suite66_enable_live_services(){
[ -d /var/lib/66/system/boot ] || 66-tree -n boot
[ -d /var/lib/66/system/default ] || 66-tree -ncE default
66-enable -t default artix-live pacman-init
if [ -f /usr/bin/gdm ]; then
66-disable -t default logind gdm
sed -i -E 's#@depends\s*=\s*\(\s*([^)]+)\s*\)#@depends = ( \1artix-live pacman-init )#' /etc/66/service/gdm
66-enable -t default logind gdm
elif [ -f /usr/bin/lightdm ]; then
66-disable -t default logind lightdm
sed -i -E 's#@depends\s*=\s*\(\s*([^)]+)\s*\)#@depends = ( \1artix-live pacman-init )#' /etc/66/service/lightdm
66-enable -t default logind lightdm
elif [ -f /usr/bin/sddm ]; then
66-disable -t default logind sddm
sed -i -E 's#@depends\s*=\s*\(\s*([^)]+)\s*\)#@depends = ( \1artix-live pacman-init )#' /etc/66/service/sddm
66-enable -t default logind sddm
fi
66-enable -t boot -F boot@system
}
suite66_disable_live_services(){
66-disable -t default artix-live pacman-init
if [ -f /usr/bin/gdm ]; then
66-disable -t default logind gdm
sed -i -E 's# artix-live pacman-init##' /etc/66/service/gdm
66-enable -t default logind gdm
elif [ -f /usr/bin/lightdm ]; then
66-disable -t default logind lightdm
sed -i -E 's# artix-live pacman-init##' /etc/66/service/lightdm
66-enable -t default logind lightdm
elif [ -f /usr/bin/sddm ]; then
66-disable -t default logind sddm
sed -i -E 's# artix-live pacman-init##' /etc/66/service/sddm
66-enable -t default logind sddm
fi
66-enable -t boot -F boot@system
}
enable_live_services() {
if [ -f /usr/bin/s6-init ]; then
s6_enable_live_services
fi
if [ -f /usr/bin/suite66-init ]; then
suite66_enable_live_services
fi
}
disable_live_services() {
if [ -f /usr/bin/s6-init ]; then
s6_disable_live_services
fi
if [ -f /usr/bin/suite66-init ]; then
suite66_disable_live_services
fi
}
case "$1" in
enable) enable_live_services ;;
disable) disable_live_services ;;
*) echo >&2 " Invalid operation '$1'"; exit 1 ;;
esac