Git Codebase - Sn0wlink IT
SMS AAISP Command Line
Code:
Download ZIP
LICENSE
README.md
sms-aaisp
README.md
# SMS AAISP Command Line Tool A simple Bash script for sending SMS text messages via the **Andrews & Arnold (AAISP)** SMS gateway. It uses *curl* to POST messages to *https://sms.aa.net.uk/sms.cgi*, allowing you to send SMS messages from the command line or from scripts/cron jobs. --- ## Requirements - **Bash** - **curl** - An active **Andrews & Arnold** account with SMS enabled --- ## Installation 1. Save the script as *sms-aaisp* 2. Install it into your personal *bin* directory: ``` mkdir -p ~/bin mv sms-aaisp ~/bin/ chmod +x ~/bin/sms-aaisp ``` 1. Ensure *~/bin* is in your *PATH* (usually already is on modern Debian) If not, add this to *~/.profile* or *~/.bashrc*: ``` export PATH="$HOME/bin:$PATH" ``` Log out and back in (or reload your shell) after changing *PATH*. --- ## Configuration Edit the script and set your **AAISP credentials**: ``` AAISP_USERNAME="+441234567890" AAISP_PASSWORD="your_api_password_here" AAISP_URL="https://sms.aa.net.uk/sms.cgi" ``` ### Notes - *AAISP_USERNAME* is typically your **landline number** in international format (*+44...*) - *AAISP_PASSWORD* is your **AAISP control panel SMS password**, **not** your main account password - Keep this file readable **only by you**: - ``` chmod 700 ~/bin/sms-aaisp ``` --- ## Script Behaviour - Sends a single SMS message using AAISP’s HTTP POST interface - Suppresses curl output (*--silent*) - Prints a confirmation message when complete Example output: ``` Message Sent ``` --- ## Usage ``` sms-aaisp <destination_number> "<message text>" ``` ### Example ``` sms-aaisp 07123456789 "This is a test SMS." ``` Numbers should normally be supplied in **UK national format** (as expected by AAISP). ## Script Behaviour - Sends a single SMS message using AAISP’s HTTP POST interface - Suppresses curl output (*--silent*) - Prints a confirmation message when complete Example output: ``` Message Sent ``` ## Error Handling This script does **not** currently parse or validate server responses. If you need robust error handling: - Remove *--silent* from *curl* - Capture and inspect the HTTP response - Check exit codes in calling scripts --- ## Security Considerations - Credentials are stored **in plaintext** inside the script - Do **not** commit this file to version control - Restrict permissions to prevent other users reading it - Consider sourcing credentials from environment variables if used in shared systems --- ## References - Andrews & Arnold SMS service https://aa.net.uk/sms/