add a script to the shortcut

25 views
Skip to first unread message

Fab76

unread,
Aug 23, 2015, 7:20:21 AM8/23/15
to Alt-F

Hello all,

I Wonder if is it possible to execute some scripts from the alt-f shortcut.

To resume, I've created a little script using  awake to WOL my home pcs, but I can only execute this script with ssh.

I've found  Shortcuts.men, is it possible to add the my script to this, to be able to use it without ssh?

Thanks :)

João Cardoso

unread,
Aug 23, 2015, 9:49:20 AM8/23/15
to Alt-F
Yes, nice idea.

I have added 'My Page|/cgi-bin/foo.gci' to /usr/www/cgi-bin/Shortcuts.men and created /usr/www/cgi-bin/foo.cgi with the following content:

#!/bin/sh

. common.sh
check_cookie
write_header
"My Script"

echo
"Executing /usr/www/cgi-bin/foo.cgi"
echo
"<pre>"

# your commands start here
uname
-r
mount

# end of your commands

echo
"</pre></body></html>"


After making it executable by using 'chmod +x /usr/www/cgi-bin/foo.gci' it worked as expected:




 

Thanks :)

Fab76

unread,
Aug 23, 2015, 10:06:03 AM8/23/15
to Alt-F
It worked like a charm, thanks you very much João
Reply all
Reply to author
Forward
0 new messages