-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall-cli.sh
More file actions
38 lines (29 loc) · 1.03 KB
/
install-cli.sh
File metadata and controls
38 lines (29 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
echo "📥 Downloading SMSMobileAPI CLI script..."
curl -s -O https://smsmobileapi.com/downloads-cli/smsmobileapi.sh
if [ ! -f smsmobileapi.sh ]; then
echo "❌ Failed to download smsmobileapi.sh"
exit 1
fi
# Convert to UNIX format if dos2unix exists
if command -v dos2unix &> /dev/null; then
dos2unix smsmobileapi.sh >/dev/null 2>&1
fi
chmod +x smsmobileapi.sh
sudo mv smsmobileapi.sh /usr/local/bin/smsmobileapi
echo "✅ Installation complete."
echo ""
# Prompt for API key
read -p "🔐 Enter your SMSMobileAPI API key to save it (optional, just press Enter to skip): " USER_API_KEY
if [ -n "$USER_API_KEY" ]; then
CONFIG_PATH="$HOME/.smsmobileapi.conf"
echo "apikey=$USER_API_KEY" > "$CONFIG_PATH"
chmod 600 "$CONFIG_PATH"
echo "✅ API key saved to $CONFIG_PATH"
else
echo "ℹ️ You can manually create ~/.smsmobileapi.conf with your API key:"
echo "apikey=YOUR_API_KEY"
fi
echo ""
echo "🚀 You can now run:"
echo "smsmobileapi send --to \"+3247xxxxxxx\" --message \"Hello\" --via sms"