addsite: Check we're not running as root.
authorMatthijs Kooijman <matthijs@stdin.nl>
Wed, 29 Jul 2009 08:05:34 +0000 (10:05 +0200)
committerMatthijs Kooijman <matthijs@stdin.nl>
Wed, 29 Jul 2009 08:05:34 +0000 (10:05 +0200)
usr/local/bin/addsite

index dcae1079667bd8661963d0aa051fcba71d47b091..9ef8ae46876253e7881b007541091e35d4df3897 100755 (executable)
@@ -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 <dirname>"
        echo "<dirname> is the full path to the site, such as /var/www/example.nl"