mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add .cgi as an extension for Python and Bash
This commit is contained in:
27
samples/Shell/settime.cgi
Normal file
27
samples/Shell/settime.cgi
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
echo "Content-type: text/html"
|
||||
day=`echo "$QUERY_STRING" | sed -n 's/^.*day=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
|
||||
month=`echo "$QUERY_STRING" | sed -n 's/^.*month=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
|
||||
year=`echo "$QUERY_STRING" | sed -n 's/^.*year=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
|
||||
hour=`echo "$QUERY_STRING" | sed -n 's/^.*hour=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
|
||||
minute=`echo "$QUERY_STRING" | sed -n 's/^.*minute=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
|
||||
second=`echo "$QUERY_STRING" | sed -n 's/^.*second=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
|
||||
echo ""
|
||||
echo "<html><body>"
|
||||
|
||||
echo "<pre> $(killall ems) </pre>"
|
||||
|
||||
|
||||
|
||||
echo "<pre> $(date $month$day$hour$minute$year.$second) </pre>"
|
||||
|
||||
echo "<pre> $(/sbin/hwclock -w>/dev/null & /sbin/reboot) </pre>"
|
||||
|
||||
echo "<pre> $(/sbin/reboot) </pre>"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo "</body></html>"
|
||||
Reference in New Issue
Block a user