Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Verify that user is root and quit of not.

  • Loading branch information...
commit fe16cb8f67b091bc6406f1dd06e101d4ad686ec9 1 parent f16c936
@Wicla authored
Showing with 12 additions and 0 deletions.
  1. +6 −0 client/iptables-client.sh
  2. +6 −0 server/iptables-standalone-server.sh
View
6 client/iptables-client.sh
@@ -23,6 +23,12 @@
# * ICMP requests
# * Dynamically definied ports (arrays)
+# Test if user has super privileges
+if [ $(id -u) -ne 0 ]; then
+ echo 'This script requires to be run as root.'
+ exit 1
+fi
+
####################### CONFIGURATION BEGINS HERE ##############################
# Set USEWICD to true be able to use this script as a wicd script.
View
6 server/iptables-standalone-server.sh
@@ -21,6 +21,12 @@
# * ICMP requests
# * Dynamically definied ports (arrays)
+# Test if user has super privileges
+if [ $(id -u) -ne 0 ]; then
+ echo 'This script requires to be run as root.'
+ exit 1
+fi
+
####################### CONFIGURATION BEGINS HERE ##############################
# IF is your interface. Normally eth0.
Please sign in to comment.
Something went wrong with that request. Please try again.