Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

cyosp/freemobile-smsapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

freemobile-smsapi

A Bash API for Free Mobile notification service

Stable version BSD-3 license

freemobile-smsapi is a Bash library which allows to use Free Mobile SMS notification service.

Free Mobile SMS notification service

To be able to use Free Mobile SMS notification service, you must have:

  • Subscribed a mobile line with Free Mobile operator.

    It's on this line SMS will be sent.

  • Enable SMS notification service.

This will give you an authentication key.

With your Free Mobile login and the authentication key you have all information to use this library.

Library files

This library is composed of two files:

  • /etc/freemobile-smsapi/freemobile-smsapi.conf.src

    The configuration file

  • /usr/lib/freemobile-smsapi/freemobile-smsapi.bash.src

    The library

Both are located inside the directory freemobile-smsapi which allows to build a Debian package.

Configuration file

Configuration file: /etc/freemobile-smsapi/freemobile-smsapi.conf.src is in fact a file which is sourced by the Bash library.

Thus syntax is the Bash one and is composed of the following variables:

Name Meaning
USER Free Mobile login
PASS Authentication key associated to login

Example:

# Free Mobile login
USER="12345678"
# Authentication key associated to login
PASS="1a2B3c4D5e6F7g"

HOW TO

Use

To use the library there are only two steps:

  1. Source the library:
. /usr/lib/freemobile-smsapi/freemobile-smsapi.bash.src
  1. Call the function to send a SMS:
callFreeMobileSmsApi "My first SMS"

In this example My first SMS will be sent to the phone number associated with the Free Mobile account defined in the configuration file.

Exit code will be 0 in case of success, 1 otherwise.

Create Debian package

You can create the Debian package with the following commands:

# Move to the repository directory
cd /github/freemobile-smsapi/repository/path
# Generate the Debian package
sudo dpkg-deb --build freemobile-smsapi
# Update the package name following Debian convention
VERSION=$(grep "Version" freemobile-smsapi/DEBIAN/control | cut -d ' ' -f 2)
ARCH=$(grep "Architecture" freemobile-smsapi/DEBIAN/control | cut -d ' ' -f 2)
mv freemobile-smsapi.deb freemobile-smsapi_${VERSION}_${ARCH}.deb

About

Bash API for Free Mobile notification service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages