Procházet zdrojové kódy

Remove unncessary user check and allow script to be run only by root

Robert Zollner před 6 roky
rodič
revize
9c74bcc991
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 4 4
      bin/v-open-fs-config

+ 4 - 4
bin/v-open-fs-config

@@ -12,10 +12,10 @@ if [ -z "$src_file" ]; then
     exit 1
 fi
 
-# Checking hestia user
-if [ ! -d "$HESTIA/data/users/$user" ]; then
-    echo "Error: hestia user $user doesn't exist"
-    exit 3
+# Checking root permissions
+if [ "$(id -u)" != '0' ]; then
+    echo "Error: Script can be run executed only by root"
+    exit 10
 fi
 
 # Checking file on fs