From: Matthijs Kooijman Date: Wed, 29 Jul 2009 08:05:34 +0000 (+0200) Subject: addsite: Check we're not running as root. X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fservers%2Fdrsnuggles.git;a=commitdiff_plain;h=47aae9573917c701ea8548548d1fe2b0e9bc662f addsite: Check we're not running as root. --- diff --git a/usr/local/bin/addsite b/usr/local/bin/addsite index dcae107..9ef8ae4 100755 --- a/usr/local/bin/addsite +++ b/usr/local/bin/addsite @@ -1,5 +1,10 @@ #!/bin/sh +if [ "$UID" -eq 0 ]; then + echo "No need to run as root." + exit 1 +fi + if [ "$1" = "-h" -o "$1" = "--help" -o $# -ne 1 ]; then echo "Usage $0 " echo " is the full path to the site, such as /var/www/example.nl"