diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-04-04 14:05:43 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-04-04 14:56:05 +0200 |
commit | 080be6c22f287d24133f5d319e083d7674c4ed0b (patch) | |
tree | f50acabe5c8b8ed20649140220f2cdb7e76fe49d /bin/itzks-goodbye-user-session | |
parent | d94d938d1458edeaf4bfea031a5a32017a4c47b5 (diff) | |
download | itzks-systems-080be6c22f287d24133f5d319e083d7674c4ed0b.tar.gz itzks-systems-080be6c22f287d24133f5d319e083d7674c4ed0b.tar.bz2 itzks-systems-080be6c22f287d24133f5d319e083d7674c4ed0b.zip |
Rename script: itzks-user-suicide -> itzks-goodbye-user-session.
Diffstat (limited to 'bin/itzks-goodbye-user-session')
-rwxr-xr-x | bin/itzks-goodbye-user-session | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/bin/itzks-goodbye-user-session b/bin/itzks-goodbye-user-session new file mode 100755 index 0000000..82e2633 --- /dev/null +++ b/bin/itzks-goodbye-user-session @@ -0,0 +1,43 @@ +#!/bin/bash + +# Copyright (C) 2017 Mike Gabriel <mike.gabriel@das-netzwerkteam.de> +# Copyright (C) 2017 Benjamin Schlüter <bschlueter@posteo.de> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +if [ $EUID -ge 500 ]; then + + # safety net for well-known browsers + pkill -TERM -u "${LOGNAME}" x-www-browser + pkill -TERM -u "${LOGNAME}" firefox-esr + pkill -TERM -u "${LOGNAME}" firefox + pkill -TERM -u "${LOGNAME}" iceweasel + pkill -TERM -u "${LOGNAME}" chromium + pkill -TERM -u "${LOGNAME}" chrome + pkill -TERM -u "${LOGNAME}" konqueror + pkill -TERM -u "${LOGNAME}" midori + pkill -TERM -u "${LOGNAME}" opera + sleep 1 + + # dump all other processes the hard way... + pkill -KILL -u "${LOGNAME}" + +else + + echo "$(basename $0): System accounts are not allowed to commit suicide." + +fi + +exit 0 |