summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2025-01-24 16:28:30 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2025-01-24 16:28:30 +0100
commitf2c81d3bb484d27a9af019d3934fbf4620e9514d (patch)
treec015a36f0afd81b2c4adbc7980cb5fbaa054afcf
parent8952f4553469c8566fec3a4f41834488ef22b7ab (diff)
downloaditzks-systems-f2c81d3bb484d27a9af019d3934fbf4620e9514d.tar.gz
itzks-systems-f2c81d3bb484d27a9af019d3934fbf4620e9514d.tar.bz2
itzks-systems-f2c81d3bb484d27a9af019d3934fbf4620e9514d.zip
sbin/<several>: Check if script is running as root.
-rwxr-xr-xsbin/diskless-workstation-shell.bullseye6
-rwxr-xr-xsbin/e2guardian-setup-sslmitm5
-rwxr-xr-xsbin/e2guardian-update-blacklists5
-rwxr-xr-xsbin/itzks-diskless-re-partition-dlw5
-rwxr-xr-xsbin/itzks-transfer-cleaner6
-rwxr-xr-xsbin/itzks-transfer-create5
6 files changed, 31 insertions, 1 deletions
diff --git a/sbin/diskless-workstation-shell.bullseye b/sbin/diskless-workstation-shell.bullseye
index ec9acc8..e764684 100755
--- a/sbin/diskless-workstation-shell.bullseye
+++ b/sbin/diskless-workstation-shell.bullseye
@@ -17,6 +17,12 @@
# Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+if [ $(id -u) -gt 0 ]; then
+ echo "ERROR: This script has to run as super-user root."
+ exit 1
+fi
+
+
set -e
VERSION=0.3
diff --git a/sbin/e2guardian-setup-sslmitm b/sbin/e2guardian-setup-sslmitm
index cfde66f..536497e 100755
--- a/sbin/e2guardian-setup-sslmitm
+++ b/sbin/e2guardian-setup-sslmitm
@@ -17,6 +17,11 @@
# Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+if [ $(id -u) -gt 0 ]; then
+ echo "ERROR: This script has to run as super-user root."
+ exit 1
+fi
+
set -e
NULL=""
diff --git a/sbin/e2guardian-update-blacklists b/sbin/e2guardian-update-blacklists
index c58c96b..ad275ec 100755
--- a/sbin/e2guardian-update-blacklists
+++ b/sbin/e2guardian-update-blacklists
@@ -17,6 +17,11 @@
# Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+if [ $(id -u) -gt 0 ]; then
+ echo "ERROR: This script has to run as super-user root."
+ exit 1
+fi
+
set -e
unset http_proxy
diff --git a/sbin/itzks-diskless-re-partition-dlw b/sbin/itzks-diskless-re-partition-dlw
index a34d0a0..c31279d 100755
--- a/sbin/itzks-diskless-re-partition-dlw
+++ b/sbin/itzks-diskless-re-partition-dlw
@@ -21,7 +21,10 @@
# storage, first partition containing 16GB swap space, second
# partition containing a scratch partition for local storage.
-#!/bin/bash
+if [ $(id -u) -gt 0 ]; then
+ echo "ERROR: This script has to run as super-user root."
+ exit 1
+fi
DEV="$1" # pick your disk device
p=""
diff --git a/sbin/itzks-transfer-cleaner b/sbin/itzks-transfer-cleaner
index 4bd530c..ac63999 100755
--- a/sbin/itzks-transfer-cleaner
+++ b/sbin/itzks-transfer-cleaner
@@ -1,5 +1,11 @@
#!/bin/bash
+if [ $(id -u) -gt 0 ]; then
+ echo "ERROR: This script has to run as super-user root."
+ exit 1
+fi
+
+
test -e /etc/debian-edu/itzks.config && . /etc/debian-edu/itzks.config || exit -1
declare -i warn_time=`echo $TRANSFER_DEL_WARNING | awk {'print $2'}`
diff --git a/sbin/itzks-transfer-create b/sbin/itzks-transfer-create
index c770164..21d09fd 100755
--- a/sbin/itzks-transfer-create
+++ b/sbin/itzks-transfer-create
@@ -18,6 +18,11 @@
# Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+if [ $(id -u) -gt 0 ]; then
+ echo "ERROR: This script has to run as super-user root."
+ exit 1
+fi
+
TRANSFER_BASE="/skole/tjener/transfer"
TRANSFER_TEACHERS="${TRANSFER_BASE}/nur-Lehrer"
TRANSFER_STUDENTS="${TRANSFER_BASE}/Schüler+Lehrer"