#!/bin/sh # Copyright (C) 2005 - 2023 The T2 SDE Project echo "Sending all processes a SIGTERM (15)" killall5 -15 if [ $? -eq 2 ]; then sleep 3 echo "Sending all processes a 2nd SIGTERM (15)" killall5 -15 if [ $? -eq 2 ]; then sleep 5 fi fi echo "Sending all processes a SIGKILL (9)" killall5 -9 if [ $? -eq 2 ]; then sleep 5 fi echo "Turning off swap devices" swapoff -a sync echo "Unmounting filesystems" umount -avf if [[ "$*" = *-h* ]]; then echo "Powering off" halt -pf else echo "Rebooting the system" reboot -f -k fi