i#!/bin/sh echo "Content-type: text/html\n" # read in our parameters CMD=`echo "$QUERY_STRING" | sed -n 's/^.*cmd=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"` FOLDER=`echo "$QUERY_STRING" | sed -n 's/^.*folder=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"| sed "s/%2F/\//g"` FOLDER1=`echo "$QUERY_STRING" | sed -n 's/^.*folder1=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"| sed "s/%2F/\//g"` FOLDER2=`echo "$QUERY_STRING" | sed -n 's/^.*folder2=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"| sed "s/%2F/\//g"` # our html header echo "" echo "
" /sbin/ifconfig echo "" ;; uname) echo "Output of uname -a :
" /bin/uname -a echo "" ;; dmesg) echo "Output of dmesg :
" /bin/dmesg echo "" ;; df) echo "Output of df -h :
" /bin/df -h echo "" ;; free) echo "Output of free :
" /usr/bin/free echo "" ;; hw) echo "Hardware listing :
" /usr/bin/lshw echo "" ;; lsusb) echo "lsusb :
" /usr/bin/lsusb echo "" ;; lsuser) echo "List of users :
" /usr/bin/lsuser echo "" ;; ls) echo "Output of ls $FOLDER :
" /bin/ls "$FOLDER" echo "" ;; lsal) echo "Output of ls $FOLDER1 :
" /bin/ls -al "$FOLDER1" echo "" ;; wol) echo "System to wake: $FOLDER2 :
" /usr/bin/wakeonlan "$FOLDER2" echo "" ;; lsb_release) echo "Ubuntu version :
" /usr/bin/lsb_release -a echo "" ;; cpuinfo) echo "Cpu information :
" cat /proc/cpuinfo echo "" ;; *) echo "Unknown command $CMD
" echo "
" echo "
" echo "Choose which command you want to run" echo "
" echo "" echo ""