Code

adding bug founds when using gosa
[gosa.git] / contrib / fix_config.sh
1 #!/bin/sh
3 CONF=/etc/gosa/gosa.conf
4 cat << EOF
6 This script will take your current $CONF and will update the menu and tab tags. It
7 will not touch the parts you have touched between the main tabs.  A backup copy is
8 created.
10 EOF
11 read -n1 -sp "Do you want to continue? (y/n)" answer
12 echo
14 if [ "$answer" != "y" -a "$answer" != "Y" ]; then
15         echo "Aborted."
16         echo
17         exit 1
18 fi
20 if [ ! -f $CONF ]; then
21         echo "Can't find $CONF Aborted."
22         echo
23         exit 1
24 fi
26 cp $CONF $CONF.orig
28 main=$(sed -n '/<main/,/\/main>/p' $CONF)
30 cat << EOF > $CONF
31 <?xml version="1.0"?>
32 <conf>
33         <menu>
34                 <section name="My account">
35                         <plugin acl="default" class="user" icon="personal.png"
36                                 path="plugins/personal/generic" />
37                         <plugin acl="default" class="posixAccount" icon="posix.png"
38                                 path="plugins/personal/posix" />
39                         <plugin acl="default" class="mailAccount" icon="email.png"
40                                 path="plugins/personal/mail" />
41                         <plugin acl="default" class="sambaAccount" icon="samba.png"
42                                 path="plugins/personal/samba" />
43                         <plugin acl="default" class="proxyAccount" icon="proxy.png"
44                                 path="plugins/personal/proxy" />
45                         <plugin acl="default" class="pureftpdAccount" icon="ftp.png"
46                                 path="plugins/personal/pureftpd" />
47                         <plugin acl="default" class="gofaxAccount" icon="fax.png"
48                                 path="plugins/gofax/faxaccount" />
49                         <plugin acl="default" class="phoneAccount" icon="phone.png"
50                                 path="plugins/gofon/phoneaccount" />
51                         <plugin acl="default" class="password" icon="password.png"
52                                 path="plugins/personal/password" />
53                 </section>
55                 <section name="Administration">
56                         <plugin acl="user" class="userManagement" icon="user.png"
57                                 path="plugins/admin/users" />
58                         <plugin acl="group" class="groupManagement" icon="group.png"
59                                 path="plugins/admin/groups" />
60                         <plugin acl="ogroup" class="ogroupManagement" icon="ogroup.png"
61                                 path="plugins/admin/ogroups" />
62                         <plugin acl="department" class="departmentManagement" icon="department.png"
63                                 path="plugins/admin/departments" />
64                         <plugin acl="application" class="applicationManagement"
65                                 icon="application.png" path="plugins/admin/applications" />
66                         <plugin acl="blocklists" class="blocklist" icon="blocklists.png"
67                                 path="plugins/gofax/blocklists" />
68                         <plugin acl="system" class="systems" icon="system.png"
69                                 path="plugins/admin/systems" />
70                 </section>
72                 <section name="Addons">
73                         <plugin acl="default" class="addressbook" icon="addressbook.png"
74                                 path="plugins/addons/addressbook" />
75                         <plugin acl="default" class="faxreport"  icon="reports.png"
76                                 path="plugins/gofax/reports" />
77                         <plugin acl="default" class="fonreport"  icon="phonereport.png"
78                                 path="plugins/gofon/reports" />
79                         <plugin acl="logs" class="logview" icon="logview.png"
80                                 path="plugins/addons/logview" />
81                         <plugin acl="ldif" class="export" icon="ldif.png"
82                                 path="plugins/addons/ldifexport" />
83                 </section>
84         </menu>
86         <usertabs>
87                 <tab class="user" name="Generic" />
88                 <tab class="posixAccount" name="Unix" />
89                 <tab class="mailAccount" name="Mail" />
90                 <tab class="sambaAccount" name="Samba" />
91                 <tab class="proxyAccount" name="Proxy" />
92                 <tab class="pureftpdAccount" name="FTP" />
93                 <tab class="gofaxAccount" name="Fax" />
94                 <tab class="phoneAccount" name="Phone" />
95                 <tab class="reference" name="References" />
96         </usertabs>
98         <grouptabs>
99                 <tab class="group" name="Generic" />
100                 <tab class="appgroup" name="Applications" />
101                 <tab class="mailgroup" name="Mail" />
102                 <tab class="acl" name="ACL" />
103                 <tab class="reference" name="References" />
104         </grouptabs>
106         <appstabs>
107                 <tab class="application" name="Generic" />
108                 <tab class="applicationParameters" name="Options" />
109                 <tab class="reference" name="References" />
110         </appstabs>
112         <termtabs>
113                 <tab class="termgeneric" name="Generic" />
114                 <tab class="termservice" name="Devices" />
115                 <tab class="termstartup" name="Startup" />
116                 <tab class="terminfo" name="Monitoring"
117                         wakecmd="/usr/bin/sudo /usr/sbin/etherwake" />
118                 <tab class="reference" name="References" />
119         </termtabs>
121         <worktabs>
122                 <tab class="workgeneric" name="Generic" />
123                 <tab class="termservice" name="Devices" />
124                 <tab class="termstartup" name="Startup" />
125                 <tab class="terminfo" name="Monitoring"
126                         wakecmd="/usr/bin/sudo /usr/sbin/etherwake" />
127                 <tab class="reference" name="References" />
128         </worktabs>
130         <printtabs>
131                 <tab class="printgeneric" name="Generic" />
132                 <tab class="reference" name="References" />
133         </printtabs>
135         <phonetabs>
136                 <tab class="phonegeneric" name="Generic" />
137                 <tab class="reference" name="References" />
138         </phonetabs>
140         <deptabs>
141                 <tab class="department" name="Generic" />
142                 <tab class="reference" name="References" />
143         </deptabs>
145         <ogrouptabs>
146                 <tab class="ogroup" name="Generic" />
147                 <tab class="reference" name="References" />
148         </ogrouptabs>
150 $main
152 </conf>
153 EOF