]> git.sur5r.net Git - bacula/rescue/blobdiff - rescue/linux/usb/src/scripts/restore/clientdir
Add new usb rescue key code
[bacula/rescue] / rescue / linux / usb / src / scripts / restore / clientdir
diff --git a/rescue/linux/usb/src/scripts/restore/clientdir b/rescue/linux/usb/src/scripts/restore/clientdir
new file mode 100755 (executable)
index 0000000..322dd57
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh
+s="off \\"
+
+if [ -f ./nozen ]; then 
+DIALOG=dialog
+else
+DIALOG=Xdialog
+fi
+
+x=1
+if [ -f clientmp ];then
+rm clientmp
+fi
+
+cp client clientmp
+
+ls ../clients|while read line;do
+b=`echo $line |cut -d" " -f1|cut -c 1`
+
+if [ "$b" = "/" ];then
+f=1
+else
+f=2
+fi
+line=`echo $line |cut -d" " -f$f`
+echo $line "-" $s >>clientmp
+echo $x>tmp
+x=$(( x + 1 ))
+
+done
+y=`cat tmp`
+rm tmp
+sed -i s/zzz/$y/g clientmp
+echo "2>ans">>clientmp
+chmod +x clientmp
+
+. ./clientmp
+if [ ! $? = 0 ];then
+exit 1
+fi
+
+clientdir=`cat ans|cut -d'"' -f2`
+
+rm ans
+#echo $clientdir
+
+