#!/usr/sbin/blassic
' /var/www/html/cgi-bin/xxxxx/xxxxx.bas
string1$ = programarg$(1)
PRINT "
Text below printed by Blassic program
"
PRINT "string = ", string1$,"
"
IF string1$ = "office_light_on" THEN GOSUB office_light_on
IF string1$ = "office_light_off" THEN GOSUB office_light_off
IF string1$ = "command1" THEN GOSUB command1
IF string1$ = "command2" THEN GOSUB command2
IF string1$ = "longreport" THEN GOSUB longreport
PRINT "Now back to the .cgi script to show router uptime
"
SYSTEM
LABEL office_light_on
SHELL "gpio -g write 17 1"
RETURN
LABEL office_light_off
SHELL "gpio -g write 17 0"
RETURN
LABEL command1
OPEN "/var/www/ramdisk/alexa_link.txt" FOR OUTPUT AS #1 : PRINT #1,"command1" : CLOSE #1
RETURN
LABEL command2
OPEN "/var/www/ramdisk/alexa_link.txt" FOR OUTPUT AS #1 : PRINT #1,"command2" : CLOSE #1
RETURN
LABEL longreport
OPEN "/var/www/ramdisk/alexa_link.txt" FOR OUTPUT AS #1 : PRINT #1,"longreport" : CLOSE #1
RETURN