# HG changeset patch # User Christophe Lincoln # Date 1486741918 -3600 # Node ID be910dd6a36c35cc5ecdbe4cd45ba07106ad44f4 # Parent bcaad2bc76c84dfbd4793f1a65aec2f079aea2d2 Add Tazbug debug plugin diff -r bcaad2bc76c8 -r be910dd6a36c web/plugins/debug/debug.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/plugins/debug/debug.cgi Fri Feb 10 16:51:58 2017 +0100 @@ -0,0 +1,45 @@ +#!/bin/sh +# +# TazBug Plugin - Debug Tazbug :-) +# + +if [ "$(GET debug)" ]; then + d="Debug" + header + html_header + user_box + if ! check_auth; then + gettext "You must be logged in to view the dashboard" + exit 0 + fi + cat << EOT +

Debug interface

+
+ Dashboard +
+EOT + # Handle ?debug&del request + if [ "$(GET del)" ]; then + id="$(GET del)" + if [ -d "${bugdir}/${id}" ]; then + echo -n "
Removing bug ID: $id... "
+			rm -rf ${bugdir}/${id}
+			echo "Done
" + fi + fi + + # Check for bug DB consitensy + echo "

Checking for bug.conf consistency

" + for id in $(ls $bugdir | sort -g) + do + if [ $(cat ${bugdir}/${id}/bug.conf | wc -l) != 8 ]; then + echo "
"
+			echo -e "ERROR: bug ID $id - Delete\n"
+			cat ${bugdir}/${id}/bug.conf
+			echo "
" + fi + done + echo "$(ls -1 $bugdir | wc -l) bugs scanned" + + html_footer & exit 0 +fi diff -r bcaad2bc76c8 -r be910dd6a36c web/plugins/debug/debug.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/plugins/debug/debug.conf Fri Feb 10 16:51:58 2017 +0100 @@ -0,0 +1,9 @@ +# TinyCM/TazBug Plugin configuration + +PLUGIN="Debug Tazbug" +SHORT_DESC="Debug and clean-up Tazbug database" +MAINTAINER="devel@slitaz.org" +PLUGINS_TOOLS="${PLUGINS_TOOLS}" +DASHBOARD_TOOLS="${DASHBOARD_TOOLS} Debug" + +# Configurable variables used in plugin.cgi