summary refs log tree commit diff
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-07-16 16:31:00 +0200
committerManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-07-16 16:31:00 +0200
commit162ef756b4f2c1e8aa27999ada0109dfc72b19db (patch)
tree46b8a8adccbe46fc15ffdde2dc091f4bf5e4cb5e
parentInitial Release (diff)
downloadtrackless-162ef756b4f2c1e8aa27999ada0109dfc72b19db.tar.gz
trackless-162ef756b4f2c1e8aa27999ada0109dfc72b19db.tar.bz2
trackless-162ef756b4f2c1e8aa27999ada0109dfc72b19db.zip
Added root perms check
-rw-r--r--trackless5
1 files changed, 5 insertions, 0 deletions
diff --git a/trackless b/trackless
index cd1fd8b..034311e 100644
--- a/trackless
+++ b/trackless
@@ -1,5 +1,10 @@
 #!/bin/bash
 
+if [ "$EUID" -ne 0 ]
+  then echo "This script needs to be run as root."
+  exit 1
+fi
+
 IFACES=$(ip -o link show | awk -F': ' '{print $2}')
 for IFACE in $IFACES; do
     if [ $IFACE != "lo" ]; then