#!/bin/bash ENABLED=yes [[ ${ENABLED} == "yes" ]] || exit 0 #HALTPROCESSESKILL="slim kdm X lxdm xdm sddm cupsd pdnsd mc mandb" HALTPROCESSESKILL="" HALTSERVICESSTOP="" HALTEXCLUDESTOP="" PATH=/usr/lib/ublinux/scripts:$PATH . /usr/lib/ublinux/default SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null SOURCE=${SYSCONF}/system; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null SOURCE=${SYSCONF}/desktop; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null # Stop DisplayManager #HALTSERVICESSTOP="$HALTSERVICESSTOP $(echo $SERVICES_ENABLE | tr "," " ") display-manager.service" #HALTSERVICESSTOP="$HALTSERVICESSTOP $(systemctl list-units --type=service --state=running | grep -E "$DISPLAYMANAGER.*running" | awk '{$1=$1;print}' | cut -d ' ' -f 1 | xargs)" # Stop all running service #HALTSERVICESSTOP="$HALTSERVICESSTOP $(systemctl list-units --type=service --state=running | grep -E "running" | awk '{$1=$1;print}' | cut -d ' ' -f 1 | egrep -v " $HALTEXCLUDESTOP" | xargs)" for i in ${HALTSERVICESSTOP}; do [ -z "${i}" ] || systemctl stop ${i} 2>/dev/null done # Kill all users apps #GROUPFORLIST="users" #LISTUSERS=$(cut -d: -f1,4 /etc/passwd | grep $(getent group $GROUPFORLIST | cut -d: -f3) | cut -d: -f1 | xargs |tr " " ",") #LISTUSERSOTHER=$(getent group $GROUPFORLIST | cut -d: -f4) #[ -z $LISTUSERSOTHER ] || LISTUSERS="$LISTUSERS,$LISTUSERSOTHER" #pkill -U $LISTUSERS [ -z "$HALTPROCESSESKILL" ] || killall -9 $HALTPROCESSESKILL