# HG changeset patch # User Christophe Lincoln # Date 1486851151 -3600 # Node ID 01a0c06f87b6d7ba46b235a46493b9f271076841 # Parent 0f1e69658f38f8e16c447c43af2e2d334b03f538 Small fixes to sdt plugin diff -r 0f1e69658f38 -r 01a0c06f87b6 scn/plugins/sdt/sdt.cgi --- a/scn/plugins/sdt/sdt.cgi Sat Feb 11 22:07:58 2017 +0100 +++ b/scn/plugins/sdt/sdt.cgi Sat Feb 11 23:12:31 2017 +0100 @@ -7,9 +7,8 @@ # show where SliTaz OS's are in the world. DB is in the flat file: # sdt.txt & using | as separator for easy parsing. # -. /usr/lib/slitaz/httphelper.sh -std_summary() { +sdt_summary() { cat << EOT
 DB file    : sdt.txt
@@ -19,7 +18,7 @@
 EOT
 }
 
-std_table() {
+sdt_table() {
 	cat << EOT
 
@@ -48,7 +47,7 @@
 	echo "
" } -std_check_ua() { +sdt_check_ua() { if ! echo "$HTTP_USER_AGENT" | fgrep -q "SliTaz/SDT"; then echo "Only SDT clients are accepted" && exit 1 fi @@ -56,7 +55,7 @@ case " $(GET sdt) " in *\ add\ *) - std_check_ua + sdt_check_ua sdtdb="../../content/sdt/sdt.txt" date="$(date +%Y%m%d)" user=$(GET user) @@ -105,17 +104,16 @@ sdt send [username]

EOT - std_summary + sdt_summary echo "

Distro's table

" echo "
"
-		std_table
+		sdt_table
 		echo "
" html_footer exit 0 ;; *\ raw\ *) - # Plain text stats if the script is called directly - . /usr/lib/slitaz/httphelper.sh + # Plain text stats sdtdb="../../content/sdt/sdt.txt" header "Content-Type: text/plain" cat << EOT