Skip to content

Add --password-plain option #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Wysyłanie smsów z poziomu linuxowego terminala
===========

Klient napisany w bashu, pozwalający na wysyłanie wiadomości SMS w serwisie SMSAPI.pl
Wymagania: `curl`
Opcja --password-plain wymaga zainstalowanego narzędzia `openssl`

```bash
$ ./smsapi sms send --username LOGIN --password PASS 48xxxyyyzzz,48zzzyyyxxx "Hello world"
Expand All @@ -13,6 +15,7 @@ Usage: smsapi sms send [OPTIONS] <to> <message>
Options:
--username <string>
--password <password> md5 api password
--password-plain <password> api password (plain text)

--from <string> Sender name
--encoding <string> Message encoding (default:utf8)
Expand All @@ -23,7 +26,12 @@ Options:
-v Verbose
```

plik konfiguracyjny ".smsapi.rc" może się znajdowac w katalogu roboczym lub w katalogo domowym użytkownika
Utworzenie hasła md5:
```
echo -n "plain_text_password" | openssl dgst -md5
```

Plik konfiguracyjny ".smsapi.rc" może się znajdowac w katalogu roboczym lub w katalogo domowym użytkownika

=======

2 changes: 2 additions & 0 deletions smsapi
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ help() {
echo "Options:
--username <string>
--password <password> md5 api password
--password-plain <password> api password (plain text)

--from <string> Sender name
--encoding <string> Message encoding (default:utf8)
Expand Down Expand Up @@ -45,6 +46,7 @@ setParam() {
"v") VERBOSE=$2 ;;
"username") USERNAME="$2" ;;
"password") PASSWORD="$2" ;;
"password-plain") PASSWORD=$(echo -n $2 | openssl dgst -md5) ;;
"uri") URI="$2" ;;
*) OPTIONS[$1]="$2";
esac
Expand Down