Tech Support
Joined: 25 Aug 2003 Posts: 4370
|
Posted: Tue Apr 03, 2018 10:21 am Post subject: Linux Script for GetWeb |
|
|
This is for use with GetWeb and requires the GetWeb interface be configured. Basic information and an overview of GetWeb can be found here:
https://www.notepage.net/videos/overview-of-pagegate-web-interface.htm
Configuration steps can be found in our video tutorial series here:
https://www.notepage.net/videos/how-to-configure-web-interface.htm
You can also find detailed information in the PageGate Admin - GetWeb section of our documentation:
https://www.notepage.net/manuals/pg/v8/server/html/index.html
The following Linux script can be used to make calls to GetWeb's CGI Executable.
#!/bin/bash
# set each part of the URL to send
UrlToCgi=$(printf "http://127.0.0.1/scripts/webgate.exe")
RecipientVar=$(printf "?USER=")
Recipient=$(printf "pageyou")
SenderVar=$(printf "&FRM=")
Sender=$(printf "fromme")
MessageVar=$(printf "&MSG=")
# set message to all the text sent on the command line
Message=$@
# url encode message text
Message=$(php -r "echo urlencode(\"$Message\");")
# build the request URL
FullUrl=$UrlToCgi$RecipientVar$Recipient$SenderVar$Sender$MessageVar$Message
# send the request
wget -O- "$FullUrl"
You'll want to update the UrlToCgi value to the URL to your hosted webgate.exe
Update the Recipient value to the name of the recipient or group you want the messages delivered to. This doesn't necessarily have to be a static value, it can be set to a variable value. However, the name variable you submit to the field must match the name of a recipient or group as it exists in the PageGate Admin.
Update the Sender variable with the desired sender's name.
Happy messaging! |
|