| 1 |
#!/bin/sh |
|---|
| 2 |
# |
|---|
| 3 |
# This script will restore the maintanance tab that was previoulsy included on |
|---|
| 4 |
# AAH systems (Asterisk at Home). |
|---|
| 5 |
# |
|---|
| 6 |
|
|---|
| 7 |
mydir=/var/www/html/admin/modules |
|---|
| 8 |
xmlfile=module.xml |
|---|
| 9 |
|
|---|
| 10 |
# asteriskinfo |
|---|
| 11 |
mysubdir=$mydir/asteriskinfo |
|---|
| 12 |
if [ -d "$mysubdir" ] |
|---|
| 13 |
then |
|---|
| 14 |
myfile=$mysubdir/$xmlfile |
|---|
| 15 |
if [ ! -e "$myfile" ] |
|---|
| 16 |
then |
|---|
| 17 |
touch $myfile |
|---|
| 18 |
echo "<module>" > $myfile |
|---|
| 19 |
echo "<rawname>asteriskinfo</rawname>" >> $myfile |
|---|
| 20 |
echo "<name>Asterisk Info</name>" >> $myfile |
|---|
| 21 |
echo "<version>1.0</version>" >> $myfile |
|---|
| 22 |
echo "<type>tool</type>" >> $myfile |
|---|
| 23 |
echo "<category>Maintenance</category>" >> $myfile |
|---|
| 24 |
echo "<menuitems>" >> $myfile |
|---|
| 25 |
echo "<asteriskinfo>Asterisk Info</asteriskinfo>" >> $myfile |
|---|
| 26 |
echo "</menuitems>" >> $myfile |
|---|
| 27 |
echo "</module>" >> $myfile |
|---|
| 28 |
else |
|---|
| 29 |
echo File $myfile Already Exists |
|---|
| 30 |
fi |
|---|
| 31 |
inffile=page.asteriskinfo.php |
|---|
| 32 |
myfile=$mysubdir/$inffile |
|---|
| 33 |
if [ ! -e "$myfile" ] |
|---|
| 34 |
then |
|---|
| 35 |
touch $myfile |
|---|
| 36 |
echo "<h2>Asterisk Info</h2>" > $myfile |
|---|
| 37 |
echo -e "<a href=\42modules/asteriskinfo/asterisk_info.php\42 target=\42_blank\42>Asterisk Info</a>" >> $myfile |
|---|
| 38 |
else |
|---|
| 39 |
echo File $myfile Already Exists |
|---|
| 40 |
fi |
|---|
| 41 |
else |
|---|
| 42 |
echo Directory $mysubdir Does Not Exist |
|---|
| 43 |
fi |
|---|
| 44 |
|
|---|
| 45 |
# configedit |
|---|
| 46 |
mysubdir=$mydir/configedit |
|---|
| 47 |
if [ -d "$mysubdir" ] |
|---|
| 48 |
then |
|---|
| 49 |
myfile=$mysubdir/$xmlfile |
|---|
| 50 |
if [ ! -e "$myfile" ] |
|---|
| 51 |
then |
|---|
| 52 |
echo "<module>" > $myfile |
|---|
| 53 |
echo "<rawname>configedit</rawname>" >> $myfile |
|---|
| 54 |
echo "<name>ConfigEdit</name>" >> $myfile |
|---|
| 55 |
echo "<version>1.0</version>" >> $myfile |
|---|
| 56 |
echo "<type>tool</type>" >> $myfile |
|---|
| 57 |
echo "<category>Maintenance</category>" >> $myfile |
|---|
| 58 |
echo "<menuitems>" >> $myfile |
|---|
| 59 |
echo "<configedit>Config Edit</configedit>" >> $myfile |
|---|
| 60 |
echo "</menuitems>" >> $myfile |
|---|
| 61 |
echo "</module>" >> $myfile |
|---|
| 62 |
else |
|---|
| 63 |
echo File $myfile Already Exists |
|---|
| 64 |
fi |
|---|
| 65 |
inffile=page.configedit.php |
|---|
| 66 |
myfile=$mysubdir/$inffile |
|---|
| 67 |
if [ ! -e "$myfile" ] |
|---|
| 68 |
then |
|---|
| 69 |
touch $myfile |
|---|
| 70 |
echo "<h2>Config Edit</h2>" > $myfile |
|---|
| 71 |
echo -e "<a href=\42modules/configedit/phpconfig.php\42 target=\42_blank\42>Config Edit</a>" >> $myfile |
|---|
| 72 |
else |
|---|
| 73 |
echo File $myfile Already Exists |
|---|
| 74 |
fi |
|---|
| 75 |
else |
|---|
| 76 |
echo Directory $mysubdir Does Not Exist |
|---|
| 77 |
fi |
|---|
| 78 |
|
|---|
| 79 |
# ciscoconfig |
|---|
| 80 |
mysubdir=$mydir/ciscoconfig |
|---|
| 81 |
if [ -d "$mysubdir" ] |
|---|
| 82 |
then |
|---|
| 83 |
myfile=$mysubdir/$xmlfile |
|---|
| 84 |
if [ ! -e "$myfile" ] |
|---|
| 85 |
then |
|---|
| 86 |
echo "<module>" > $myfile |
|---|
| 87 |
echo "<rawname>ciscoconfig</rawname>" >> $myfile |
|---|
| 88 |
echo "<name>Cisco Config</name>" >> $myfile |
|---|
| 89 |
echo "<version>1.0</version>" >> $myfile |
|---|
| 90 |
echo "<type>tool</type>" >> $myfile |
|---|
| 91 |
echo "<category>Maintenance</category>" >> $myfile |
|---|
| 92 |
echo "<menuitems>" >> $myfile |
|---|
| 93 |
echo "<ciscoconfig>CiscoConfig</ciscoconfig>" >> $myfile |
|---|
| 94 |
echo "</menuitems>" >> $myfile |
|---|
| 95 |
echo "</module>" >> $myfile |
|---|
| 96 |
else |
|---|
| 97 |
echo File $myfile Already Exists |
|---|
| 98 |
fi |
|---|
| 99 |
inffile=page.ciscoconfig.php |
|---|
| 100 |
myfile=$mysubdir/$inffile |
|---|
| 101 |
if [ ! -e "$myfile" ] |
|---|
| 102 |
then |
|---|
| 103 |
touch $myfile |
|---|
| 104 |
echo "<h2>Cisco Config</h2>" > $myfile |
|---|
| 105 |
echo -e "<a href=\42modules/ciscoconfig/cisco_cfg/phone.html\42 target=\42_blank\42>Cisco Config</a>" >> $myfile |
|---|
| 106 |
else |
|---|
| 107 |
echo File $myfile Already Exists |
|---|
| 108 |
fi |
|---|
| 109 |
else |
|---|
| 110 |
echo Directory $mysubdir Does Not Exist |
|---|
| 111 |
fi |
|---|
| 112 |
|
|---|
| 113 |
# phpmyadmin |
|---|
| 114 |
mysubdir=$mydir/phpmyadmin |
|---|
| 115 |
if [ -d "$mysubdir" ] |
|---|
| 116 |
then |
|---|
| 117 |
myfile=$mysubdir/$xmlfile |
|---|
| 118 |
if [ ! -e "$myfile" ] |
|---|
| 119 |
then |
|---|
| 120 |
echo "<module>" > $myfile |
|---|
| 121 |
echo "<rawname>phpmyadmin</rawname>" >> $myfile |
|---|
| 122 |
echo "<name>phpMyAdmin</name>" >> $myfile |
|---|
| 123 |
echo "<version>2.8.0.2</version>" >> $myfile |
|---|
| 124 |
echo "<type>tool</type>" >> $myfile |
|---|
| 125 |
echo "<category>Maintenance</category>" >> $myfile |
|---|
| 126 |
echo "<menuitems>" >> $myfile |
|---|
| 127 |
echo "<phpmyadmin>phpMyAdmin</phpmyadmin>" >> $myfile |
|---|
| 128 |
echo "</menuitems>" >> $myfile |
|---|
| 129 |
echo "</module>" >> $myfile |
|---|
| 130 |
else |
|---|
| 131 |
echo File $myfile Already Exists |
|---|
| 132 |
fi |
|---|
| 133 |
inffile=page.phpmyadmin.php |
|---|
| 134 |
myfile=$mysubdir/$inffile |
|---|
| 135 |
if [ ! -e "$myfile" ] |
|---|
| 136 |
then |
|---|
| 137 |
touch $myfile |
|---|
| 138 |
echo "<h2>phpMyaAmin</h2>" > $myfile |
|---|
| 139 |
echo -e "<a href=\42modules/phpmyadmin/phpMyAdmin\42 target=\42_blank\42>phpMyAdmin</a>" >> $myfile |
|---|
| 140 |
else |
|---|
| 141 |
echo File $myfile Already Exists |
|---|
| 142 |
fi |
|---|
| 143 |
else |
|---|
| 144 |
echo Directory $mysubdir Does Not Exist |
|---|
| 145 |
fi |
|---|
| 146 |
|
|---|
| 147 |
# sysinfo |
|---|
| 148 |
mysubdir=$mydir/sysinfo |
|---|
| 149 |
if [ -d "$mysubdir" ] |
|---|
| 150 |
then |
|---|
| 151 |
myfile=$mysubdir/$xmlfile |
|---|
| 152 |
if [ ! -e "$myfile" ] |
|---|
| 153 |
then |
|---|
| 154 |
echo "<module>" > $myfile |
|---|
| 155 |
echo "<rawname>sysinfo</rawname>" >> $myfile |
|---|
| 156 |
echo "<name>Sys Info</name>" >> $myfile |
|---|
| 157 |
echo "<version>1.0</version>" >> $myfile |
|---|
| 158 |
echo "<type>tool</type>" >> $myfile |
|---|
| 159 |
echo "<category>Maintenance</category>" >> $myfile |
|---|
| 160 |
echo "<menuitems>" >> $myfile |
|---|
| 161 |
echo "<sysinfo>Sys Info</sysinfo>" >> $myfile |
|---|
| 162 |
echo "</menuitems>" >> $myfile |
|---|
| 163 |
echo "</module>" >> $myfile |
|---|
| 164 |
else |
|---|
| 165 |
echo File $myfile Already Exists |
|---|
| 166 |
fi |
|---|
| 167 |
inffile=page.sysinfo.php |
|---|
| 168 |
myfile=$mysubdir/$inffile |
|---|
| 169 |
if [ ! -e "$myfile" ] |
|---|
| 170 |
then |
|---|
| 171 |
touch $myfile |
|---|
| 172 |
echo "<h2>Sys Info</h2>" > $myfile |
|---|
| 173 |
echo -e "<a href=\42modules/sysinfo/\42 target=\42_blank\42>Sys Info</a>" >> $myfile |
|---|
| 174 |
else |
|---|
| 175 |
echo File $myfile Already Exists |
|---|
| 176 |
fi |
|---|
| 177 |
else |
|---|
| 178 |
echo Directory $mysubdir Does Not Exist |
|---|
| 179 |
fi |
|---|
| 180 |
|
|---|
| 181 |
# sysstatus |
|---|
| 182 |
mysubdir=$mydir/sysstatus |
|---|
| 183 |
if [ -d "$mysubdir" ] |
|---|
| 184 |
then |
|---|
| 185 |
myfile=$mysubdir/$xmlfile |
|---|
| 186 |
if [ ! -e "$myfile" ] |
|---|
| 187 |
then |
|---|
| 188 |
echo "<module>" > $myfile |
|---|
| 189 |
echo "<rawname>sysstatus</rawname>" >> $myfile |
|---|
| 190 |
echo "<name>System Status</name>" >> $myfile |
|---|
| 191 |
echo "<version>1.0</version>" >> $myfile |
|---|
| 192 |
echo "<type>tool</type>" >> $myfile |
|---|
| 193 |
echo "<category>Maintenance</category>" >> $myfile |
|---|
| 194 |
echo "<menuitems>" >> $myfile |
|---|
| 195 |
echo "<sysstatus>System Status</sysstatus>" >> $myfile |
|---|
| 196 |
echo "</menuitems>" >> $myfile |
|---|
| 197 |
echo "</module>" >> $myfile |
|---|
| 198 |
else |
|---|
| 199 |
echo File $myfile Already Exists |
|---|
| 200 |
fi |
|---|
| 201 |
else |
|---|
| 202 |
echo Directory $mysubdir Does Not Exist |
|---|
| 203 |
fi |
|---|