fix cstream definition
[matthijs/upstream/backupninja.git] / src / ninjahelper.in
index 01164611b1361cf7d8cf5a4ea42db4bfce918dc0..040727baa7eb2de9ac54e1e85843e4ab5f4ae15f 100755 (executable)
@@ -4,23 +4,6 @@
 ####################################################
 ## Functions
 
-function check_perms() {
-   local file=$1
-   local perms=`ls -ld $file`
-   group_w_perm=${perms:5:1}
-   world_w_perm=${perms:8:1}
-   if [ "$group_w_perm" == "w" -o "$world_w_perm" == "w" ]; then
-      echo $perms
-      echo "helper scripts must not be group or world writable! Dying on file $file"
-      exit
-   fi
-   if [ `ls -ld $file | awk '{print $3}'` != "root" ]; then
-      echo "helper scripts must be owned by root! Dying on file $file"
-      exit
-   fi
-}
-
-
 ##
 ## returns the next available file name given a file
 ## in the form @CFGDIR@/backup.d/10.sys
@@ -200,7 +183,7 @@ if [ ! -r "$conffile" ]; then
 fi
 
 # find $libdirectory
-libdirectory=`grep '^libdirectory' $conffile | awk '{print $3}'`
+libdirectory=`grep '^libdirectory' $conffile | @AWK@ '{print $3}'`
 if [ -z "$libdirectory" ]; then
    if [ -d "@libdir@" ]; then
       libdirectory="@libdir@"
@@ -238,7 +221,6 @@ getconf scriptdirectory @datadir@
 # load all the helpers
 HELPERS=""
 for file in `find $scriptdirectory -follow -name '*.helper'`; do
-   check_perms $file
    . $file
    if [ $? != 0 ]; then
       echo "An error occurred while loading $file. Hit return to continue."
@@ -257,7 +239,7 @@ while true; do
 menulist=
 action=
 let "i = 1"
-for file in `find -L ${configdirectory} -mindepth 1 -maxdepth 1 -type f ! -name '.*.swp' | sort -n`; do
+for file in `find ${configdirectory} -follow -mindepth 1 -maxdepth 1 -type f ! -name '.*.swp' | sort -n`; do
    menulist="$menulist $i $file"
    actions[$i]=$file
    let "i += 1"