/
fetion.sh
executable file
·49 lines (40 loc) · 972 Bytes
/
fetion.sh
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
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
#
# Written by multiple1902 <multiple1902@gmail.com>
# Released under MIT License
#
# fetion:
# Send a feixin (Fetion) message.
#
# Usage:
# fetion.sh <receiver> <message>
#
# If no message is provided, the FETION_DEFAULT_MESSAGE would be used.
#
# Requirements:
# cliofetion from AUR
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
FETION_DATAFILE=$DIR/data/fetion.var
FETION_NUMBER=
FETION_PASSWORD=
test -r $FETION_DATAFILE && source $FETION_DATAFILE && chmod 600 $FETION_DATAFILE
if [ -z "$FETION_NUMBER" ]; then
echo "Please specify your login credentials";
exit 5
fi
if [ -z "$FETION_PASSWORD" ]; then
echo "Please specify your login credentials";
exit 5
fi
if [ -z "$1" ]; then
echo "Please specify the receiver";
exit 1;
fi
FETION_RECEIVER=$1
shift
if [ -z "$*" ]; then
echo "Please specify the message";
exit 2;
fi
cliofetion -f $FETION_NUMBER -p $FETION_PASSWORD -t $FETION_RECEIVER -d "$*"