Initial push of existing script
This commit is contained in:
commit
4b373f5043
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
lstmsg.txt
|
||||||
|
URL.txt
|
8
README.md
Normal file
8
README.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# SENDMSG
|
||||||
|
|
||||||
|
A script using Free Mobile's ["Notification par SMS"](https://mobile.free.fr/account/mes-options/notifications-sms) to
|
||||||
|
send text via SMS.
|
||||||
|
|
||||||
|
NOTE: very old script, in French. API credentials were removed.
|
||||||
|
|
||||||
|
TODO: rewrite this from scratch, possibly as a small web app / web service.
|
87
main.sh
Normal file
87
main.sh
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
###################################################################################################################################################################
|
||||||
|
|
||||||
|
fctConversion()
|
||||||
|
{
|
||||||
|
echo $MSG | sed -e "s/ /%20/g" > msg
|
||||||
|
MSG=$(cat msg)
|
||||||
|
echo $MSG | sed -e "s/ç/%C3%A7/g" > msg
|
||||||
|
MSG=$(cat msg)
|
||||||
|
echo $MSG | sed -e "s/é/%C3%A9/g" > msg
|
||||||
|
MSG=$(cat msg)
|
||||||
|
echo $MSG | sed -e "s/è/%C3%A8/g" > msg
|
||||||
|
MSG=$(cat msg)
|
||||||
|
echo $MSG | sed -e "s/à/%C3%A0/g" > msg
|
||||||
|
MSG=$(cat msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
###################################################################################################################################################################
|
||||||
|
|
||||||
|
fctDestinataire()
|
||||||
|
{
|
||||||
|
read -p 'Entrez ci-après le destinataire : ' dest
|
||||||
|
|
||||||
|
case $dest in
|
||||||
|
'alex')
|
||||||
|
user=('' '')
|
||||||
|
;;
|
||||||
|
'xav')
|
||||||
|
user=('' '')
|
||||||
|
;;
|
||||||
|
'france')
|
||||||
|
user=('' '')
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo -e 'Get lost !\n\nAppuyer sur ENTER pour fermer le programme.'
|
||||||
|
read
|
||||||
|
clear
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
###################################################################################################################################################################
|
||||||
|
|
||||||
|
clear
|
||||||
|
|
||||||
|
echo ' _____ _ _ ____ __ __ ____ '
|
||||||
|
echo '| ____|_ ____ _____ (_) __| | ___ / ___|| \/ / ___| '
|
||||||
|
echo '| _| | _ \ \ / / _ \| | / _` |/ _ \ \___ \| |\/| \___ \ '
|
||||||
|
echo '| |___| | | \ V / (_) | | | (_| | __/ ___) | | | |___) |'
|
||||||
|
echo '|_____|_| |_|\_/ \___/|_| \__,_|\___| |____/|_| |_|____/ '
|
||||||
|
echo -e "\nProposé par MasterKTO"
|
||||||
|
echo -e "\n\nCe programme vous permet d'envoyer un SMS sur votre portable en\nutilisant l'option \"Notification par SMS\" de votre forfait Free Mobile.\n"
|
||||||
|
|
||||||
|
fctDestinataire
|
||||||
|
|
||||||
|
echo -e "\nEntrez votre message ci-dessous :"
|
||||||
|
read MSG
|
||||||
|
|
||||||
|
echo $MSG > lstmsg.txt
|
||||||
|
|
||||||
|
fctConversion
|
||||||
|
|
||||||
|
name='sendmsg?user='${user[0]}'&pass='${user[1]}'&msg='$MSG
|
||||||
|
|
||||||
|
URL='https://smsapi.free-mobile.fr/'$name
|
||||||
|
|
||||||
|
echo $URL > URL.txt
|
||||||
|
|
||||||
|
echo -e "\nVous pouvez choisir d'envoyer ce message à "$dest" ou de récupérer l'URL pour un usage tiers.\nEnvoyer ? [o/n] : "
|
||||||
|
|
||||||
|
read choix
|
||||||
|
|
||||||
|
if [ "$choix" = "o" ]
|
||||||
|
then
|
||||||
|
wget $URL --no-check-certificate &> /dev/null
|
||||||
|
rm $name &> /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm msg &> /dev/null
|
||||||
|
|
||||||
|
echo -e "\nVous pouvez consulter le contenu de votre message dans le fichier lstmsg.txt.\nL'URL est également disponible dans le fichier URL.txt.\n\nAppuyer sur ENTER pour fermer le programme."
|
||||||
|
|
||||||
|
read
|
||||||
|
clear
|
||||||
|
exit 0
|
Loading…
Reference in New Issue
Block a user