]> git.sur5r.net Git - bacula/rescue/blob - rescue/linux/usb/src/scripts/restore/clientdir
Add new usb rescue key code
[bacula/rescue] / rescue / linux / usb / src / scripts / restore / clientdir
1 #!/bin/sh
2 s="off \\"
3
4 if [ -f ./nozen ]; then 
5 DIALOG=dialog
6 else
7 DIALOG=Xdialog
8 fi
9
10 x=1
11 if [ -f clientmp ];then
12 rm clientmp
13 fi
14
15 cp client clientmp
16
17 ls ../clients|while read line;do
18 b=`echo $line |cut -d" " -f1|cut -c 1`
19
20 if [ "$b" = "/" ];then
21 f=1
22 else
23 f=2
24 fi
25 line=`echo $line |cut -d" " -f$f`
26 echo $line "-" $s >>clientmp
27 echo $x>tmp
28 x=$(( x + 1 ))
29
30 done
31 y=`cat tmp`
32 rm tmp
33 sed -i s/zzz/$y/g clientmp
34 echo "2>ans">>clientmp
35 chmod +x clientmp
36
37 . ./clientmp
38 if [ ! $? = 0 ];then
39 exit 1
40 fi
41
42 clientdir=`cat ans|cut -d'"' -f2`
43
44 rm ans
45 #echo $clientdir
46
47