Browse Source

Enforce running the script with root rights

Matthias Vogelgesang 8 years ago
parent
commit
860be8183d
1 changed files with 5 additions and 0 deletions
  1. 5 0
      reload.sh

+ 5 - 0
reload.sh

@@ -1,5 +1,10 @@
 #! /bin/bash
 
+if [ $(id -u) != "0" ]; then
+    sudo "$0" "$@"
+    exit $?
+fi
+
 device=`lspci -vv | grep -m 1 Xilinx | awk '{print $1}'`
 if [ -z "$device" ]; then
     echo "Xilinx device doesn't exist, rescanning..."