tazbug annotate web/plugins/debug/debug.cgi @ rev 105
Overall improvments
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Feb 10 18:12:00 2017 +0100 (2017-02-10) |
parents | 6f798394f27e |
children | b9aaee394e0c |
rev | line source |
---|---|
pankso@101 | 1 #!/bin/sh |
pankso@101 | 2 # |
pankso@101 | 3 # TazBug Plugin - Debug Tazbug :-) |
pankso@101 | 4 # |
pankso@101 | 5 |
pankso@101 | 6 if [ "$(GET debug)" ]; then |
pankso@101 | 7 d="Debug" |
pankso@101 | 8 header |
pankso@101 | 9 html_header |
pankso@101 | 10 user_box |
pankso@105 | 11 if check_auth && ! admin_user; then |
pankso@105 | 12 gettext "You must be admin to debug" |
pankso@101 | 13 exit 0 |
pankso@101 | 14 fi |
pankso@101 | 15 cat << EOT |
pankso@101 | 16 <h2>Debug interface</h2> |
pankso@101 | 17 <div id="tools"> |
pankso@101 | 18 <a href="$script?dashboard">Dashboard</a> |
pankso@101 | 19 </div> |
pankso@101 | 20 EOT |
pankso@101 | 21 # Handle ?debug&del request |
pankso@101 | 22 if [ "$(GET del)" ]; then |
pankso@101 | 23 id="$(GET del)" |
pankso@101 | 24 if [ -d "${bugdir}/${id}" ]; then |
pankso@101 | 25 echo -n "<pre>Removing bug ID: $id... " |
pankso@101 | 26 rm -rf ${bugdir}/${id} |
pankso@101 | 27 echo "Done</pre>" |
pankso@101 | 28 fi |
pankso@101 | 29 fi |
pankso@101 | 30 |
pankso@101 | 31 # Check for bug DB consitensy |
pankso@101 | 32 echo "<h3>Checking for bug.conf consistency</h3>" |
pankso@101 | 33 for id in $(ls $bugdir | sort -g) |
pankso@101 | 34 do |
pankso@101 | 35 if [ $(cat ${bugdir}/${id}/bug.conf | wc -l) != 8 ]; then |
pankso@101 | 36 echo "<pre>" |
pankso@104 | 37 echo -e "ERROR: bug ID $id - <a href='?edit=$id'>Edit</a>\ |
pankso@104 | 38 - <a href='?debug&del=$id'>Delete</a>\n" |
pankso@101 | 39 cat ${bugdir}/${id}/bug.conf |
pankso@101 | 40 echo "</pre>" |
pankso@101 | 41 fi |
pankso@101 | 42 done |
pankso@101 | 43 echo "$(ls -1 $bugdir | wc -l) bugs scanned" |
pankso@101 | 44 |
pankso@101 | 45 html_footer & exit 0 |
pankso@101 | 46 fi |