From f2c81d3bb484d27a9af019d3934fbf4620e9514d Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 24 Jan 2025 16:28:30 +0100 Subject: sbin/: Check if script is running as root. --- sbin/itzks-diskless-re-partition-dlw | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sbin/itzks-diskless-re-partition-dlw') 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="" -- cgit v1.2.3