Commit Graph

17 Commits

Author SHA1 Message Date
C-Duv 6b68de17e9 [Shell] fix(http): URL-encode message parameter
Message was not URL-encoded when sent (as "msg" URI parameter) which
could cause issues with some messages (because of spaces).

This commits uses cURL's "--data-urlencode" option for "msg" parameter
so that cURL does the encoding for us.
As a consequence, the script don't have to manually convert newlines (to
$NEWLINE_CHAR) anymore: cURL also does that for us.
2020-01-02 00:52:15 +01:00
C-Duv a47fed2080 [Shell] qa(bash): Sets "e" and "u" Shell options
This commits sets the "e" and "u" Shell options for better error
handling.

Because of "u", an additional test is required before using variable $1.
2020-01-02 00:51:52 +01:00
C-Duv 47b06c778c Removes --insecure curl option
`curl` calls were using the `--insecure` option that makes `curl` ignore any certificate issues.
When first releasing this script, the *smsapi.free-mobile.fr* was not serving a valid/trusted SSL/TLS certificate, so `--insecure` was used to avoid getting normal but noisy errors.
Today, it seems *smsapi.free-mobile.fr*'s SSL/TLS issues are solved, so `--insecure` is not relevant anymore.

This commit removes the insecure `--insecure` option.

Closes: #2
2017-10-04 13:25:08 +02:00
C-Duv afccc39b37 Fixes configuration loading
Two bugs were introduced when adding configuration file support:
* Passing the message as script parameter was not working when `-c` option was
  used (eg. `script -c cfg msg`)
* `-c` configuration file was not loaded properly

This commit fixes these 2 bugs.
2017-02-11 16:40:39 +01:00
C-Duv 3e12046b97 Fix Markdown syntax typo 2017-02-11 15:27:23 +01:00
C-Duv a9efb5606c Merge branch 'evol/supports_configuration_file' 2017-02-11 15:21:43 +01:00
C-Duv 29abae8a06 Adds support for configuration file
The script can now be configured using configuration files.
If a file named ".freemobile-smsapi" is located next to the script or in user's
home directory, such file will be read to load
Alternatively, a file path can be specified using `-c` option at runtime.

This commit makes the script accept option to specify configuration filepath
and also look for configuration files in specific places.
2017-02-11 15:20:55 +01:00
C-Duv 0105907e20 Adds meaning about configuration variables in README
This commit explains, in the README, what each configuration variable do.
2017-02-11 15:18:18 +01:00
C-Duv 3304fde7a3 Adds "-h" option to display usage guide 2017-02-11 15:02:15 +01:00
C-Duv 6cb0faca60 MINOR: Removes trailing spaces 2017-02-11 14:47:26 +01:00
C-Duv 57e3322ea8 Merge branch 'review/coding_standards' 2017-02-05 03:30:17 +01:00
C-Duv 3001a5ae7f Apply basic coding standards
This commit does not change script behavior, it only deals with code syntax and
standards:
* Long lines were capped to 80 chars
* Long commands were splited into multiple for improved readability
* Variables are now all using the curly brace syntax
2017-02-05 03:29:47 +01:00
C-Duv 3adaffd5f3 Merge branch 'evol/rework_newline_handling' 2017-02-05 02:31:14 +01:00
C-Duv 1e7da3c883 Use variable mangling to strip last \n from message
Due to how stdin is read, the message gets a trailing "\n". sed was used to
remove it but this commit use shell variable mangling "${var%Pattern}"
instead (faster and nicer).
2017-02-05 02:28:48 +01:00
C-Duv 8aaf901c19 Avoids using $NEWLINE_CHAR variable in configuration
To simplify and improve readability of configuration options, use of standard
newline character is preferred  over $NEWLINE_CHAR.

This commit uses \n in configuration options instead of $NEWLINE_CHAR and adds
a final \n to $NEWLINE_CHAR conversion  step just prior to sending.
2017-02-05 02:21:45 +01:00
CDuv 5533d15c5b First release: Shell client 2014-06-12 00:40:22 +02:00
C-Duv e0533243fb Initial commit 2014-06-11 22:59:52 +02:00