]> git.sur5r.net Git - bacula/rescue/blob - rescue/linux/usb/src/scripts/new_baklient_conf
Add new usb rescue key code
[bacula/rescue] / rescue / linux / usb / src / scripts / new_baklient_conf
1 #!/bin/sh
2
3
4 if [ -f /etc/bacula/bacula-fd.conf ];then
5 cli="/etc/bacula/bacula-fd.conf"
6 else
7 cli="NOT"
8 fi
9 if [ $cli = "NOT" ];then
10 if [ -f /opt/etc/bacula/bacula-fd.conf ];then
11 cli="/opt/etc/bacula/bacula-fd.conf"
12 else
13 cli="NOT"
14 fi
15 fi
16
17 if [ -f ../../../scripts/nozen ]; then 
18 DIALOG=dialog
19 else
20 DIALOG=Xdialog
21 fi
22
23 if [  $cli = "NOT" ] ;then
24 $DIALOG --title "lookin for bacula-fd.conf" --msgbox "oops, couldn't find a bacula-fd.conf \n I'm afraid you'll have to locate it yourself ..." 10 60
25   $DIALOG --backtitle "Where is bacula-fd.conf? " --title "(spacebar to select)" --aspect 12 --begin 4 3 --fselect / 30 60 2>tmp
26  
27         if [ $? = 1 ];then
28         $DIALOG --title "No bacula-fd.conf" --msgbox "I AM AFRAID WE CAN'T DO ANYTHING WITHOUT A bacula-fd.conf \n \n \n THIS USB KEY WILL BE USELESS WITHOUT BACULA RUNNING ON THE CLIENT \n \n \n ABORTING !!!!!!!!!!!!!!!!!!" 600 600
29         echo "aborted!!!!!!!!!!!"
30         exit 1
31         fi
32
33   
34
35
36  bakonf=`cat tmp`
37 echo $bakonf|grep bacula-fd.conf
38     if [ $? = 1 ];then
39     $DIALOG --title "No bacula-fd.conf" --msgbox "I AM AFRAID WE CAN'T DO ANYTHING WITHOUT A bacula-fd.conf \n \n \n THIS USB KEY WILL BE USELESS WITHOUT BACULA RUNNING ON THE CLIENT \n \n \n ABORTING !!!!!!!!!!!!!!!!!!" 600 600
40     echo "aborted!!!!!!!!!!!"
41     exit 1
42     fi
43     bakonf=`cat tmp`
44     rm tmp
45  cp $bakonf ../diskinfo/
46 fi
47 if [ ! $cli = "NOT" ] ;then
48 $DIALOG --title "lookin for bacula-fd.conf" --yesno "we found a conf file in $cli, is that correct?" 10 60 
49
50
51 if [ $? = 0 ];then
52   bakonf=$cli
53   else
54
55   $DIALOG --backtitle "Where is bacula-fd.conf? " --title "(spacebar to select)" --aspect 12 --begin 4 3 --fselect / 30 60 2>tmp
56     if [ $? = 1 ];then
57     $DIALOG --title "No bacula-fd.conf" --msgbox "I AM AFRAID WE CAN'T DO ANYTHING WITHOUT A bacula-fd.conf \n \n \n THIS USB KEY WILL BE USELESS WITHOUT BACULA RUNNING ON THE CLIENT \n \n \n ABORTING !!!!!!!!!!!!!!!!!!" 600 600
58     echo "aborted!!!!!!!!!!!"
59     exit 1
60     fi
61     bakonf=`cat tmp`
62     rm tmp
63
64
65    fi
66    echo $bakonf|grep bacula-fd.conf
67         if [ ! $? = 0 ];then
68         $DIALOG --title "No bacula-fd.conf" --msgbox "I AM AFRAID WE CAN'T DO ANYTHING WITHOUT A bacula-fd.conf \n \n \n THIS USB KEY WILL BE USELESS WITHOUT BACULA RUNNING ON THE CLIENT \n \n \n ABORTING !!!!!!!!!!!!!!!!!!" 600 600
69         echo "aborted!!!!!!!!!!!"
70         exit 1
71         fi
72    cp $bakonf ../diskinfo/
73
74
75 fi
76 if [ -f /etc/bacula/bconsole.conf ];then
77 cli="/etc/bacula/bconsole.conf"
78 else
79 cli="NOT"
80 fi
81 if [ $cli = "NOT" ];then
82 if [ -f /opt/etc/bacula/bconsole.conf ];then
83 cli="/opt/etc/bacula/bconsole.conf"
84 else
85 cli="NOT"
86 fi
87 fi
88
89 if [ $cli = "NOT" ] ;then
90 $DIALOG --title "bconsole" --yesno "do you have bconsole installed on this machine ?" 10 60 
91   if [ $? = 0 ];then
92
93
94   $DIALOG --title "lookin for bconsole.conf" --msgbox "oops, couldn't find a bconsole.conf \n I'm afraid you'll have to locate it yourself ..." 10 60
95   $DIALOG --backtitle "Where is bconsole.conf? " --title "(spacebar to select)" --aspect 12 --begin 4 3 --fselect / 30 60 2>tmp
96     if [ $? = 1 ];then
97   $DIALOG --title "No bconsole.conf" --msgbox "O.K. We'll do without it \n but you will need to know your director's version \n when you restore" 10 60
98
99     else
100     bakonf=`cat tmp`
101     rm tmp
102
103
104   
105     cp $bakonf ../diskinfo/
106     fi
107   else
108   $DIALOG --title "No bconsole.conf" --msgbox "O.K. We'll do without it \n but you will need to know your director's version \n when you restore" 10 60
109   fi
110 fi
111
112
113 if [ ! $cli = "NOT" ] ;then
114 $DIALOG --title "lookin for bconsole.conf" --yesno "we found a conf file in $cli, is that correct?" 10 60 
115   if [ $? = 0 ];then
116 bakonf=$cli
117 cp $bakonf ../diskinfo/
118   else
119
120   $DIALOG --backtitle "Where is bconsole.conf? " --title "(spacebar to select)" --aspect 12 --begin 4 3 --fselect / 30 60 2>tmp
121     if [ $? = 1 ];then
122     $DIALOG --title "No bconsole.conf" --msgbox "O.K. We'll do without it \n but you will need to know your director's version \n when you restore" 10 60
123
124     else
125     bakonf=`cat tmp`
126     rm tmp
127
128
129   echo $bakonf |grep bconsole.conf
130         if [ $? = 0 ];then 
131         cp $bakonf ../diskinfo/
132         else
133         $DIALOG --title "No bconsole.conf" --msgbox "That was no bconsole.conf, \n \n O.K. We'll do without it \n but you will need to know your director's version \n when you restore" 10 60
134         fi
135     fi
136
137   fi
138 fi