README
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
- Save the script as sms-aaisp
- Install it into your personal bin directory:
mkdir -p ~/bin
mv sms-aaisp ~/bin/
chmod +x ~/bin/sms-aaisp
- 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
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