5
5
#
6
6
# uses pushover.sh from https://raw.githubusercontent.com/jnwatts/pushover.sh/master/pushover.sh
7
7
#
8
- # You need to either export PUSHOVER_API_KEY and PUSHOVER_USER_KEY, or set them in
9
- # ~/.pushover_keys.sh
10
- #
11
8
# ##################################################################################
12
9
#
13
10
# Copyright 2015 Jason Antman <[email protected] > <http://www.jasonantman.com>
28
25
#
29
26
# ##################################################################################
30
27
#
31
- # Version 1.0.0
28
+ # Version 1.0.1
32
29
#
33
30
# CHANGELOG:
34
31
#
32
+ # * 1.0.1 2015-05-11 Jason Antman <[email protected] >
33
+ # * swith from env vars for pushover keys to ~/.config/pushover.conf
34
+ #
35
35
# * 1.0.0 2015-05-11 Jason Antman <[email protected] >
36
36
# * Initial public version
37
37
#
@@ -43,18 +43,6 @@ if ! which pushover.sh > /dev/null 2>&1; then
43
43
exit 1
44
44
fi
45
45
46
- [[ -f ~ /.pushover_keys.sh ]] && source ~ /.pushover_keys.sh
47
-
48
- if [ -z " $PUSHOVER_API_KEY " ]; then
49
- >&2 echo " ERROR: export PUSHOVER_API_KEY or set in ~/.pushover_keys.sh"
50
- exit 2
51
- fi
52
-
53
- if [ -z " $PUSHOVER_USER_KEY " ]; then
54
- >&2 echo " ERROR: export PUSHOVER_USER_KEY or set in ~/.pushover_keys.sh"
55
- exit 3
56
- fi
57
-
58
46
stime=$( date ' +%s' )
59
47
$@
60
48
exitcode=$?
@@ -68,13 +56,13 @@ times=$(printf '%d:%02d:%02d' $dh $dm $ds)
68
56
# end timer
69
57
if [ " $exitcode " -eq 0 ]
70
58
then
71
- pushover.sh -p 0 -t " Command Succeeded" -T " $APIKEY " -U " $USERKEY " " succeeded in ${times} on $( hostname) : $@ (in $( pwd) )"
59
+ pushover.sh -p 0 -t " Command Succeeded" " succeeded in ${times} on $( hostname) : $@ (in $( pwd) )"
72
60
echo " (sent pushover success notification)"
73
61
if which notify-send 2>&1 > /dev/null; then
74
62
notify-send " Command Succeeded" " succeeded in ${times} : $@ (in $( pwd) )"
75
63
fi
76
64
else
77
- pushover.sh -p 0 -s falling -t " Command Failed" -T " $APIKEY " -U " $USERKEY " " failed in ${times} (exit $exitcode ) on $( hostname) : $@ (in $( pwd) )"
65
+ pushover.sh -p 0 -s falling -t " Command Failed" " failed in ${times} (exit $exitcode ) on $( hostname) : $@ (in $( pwd) )"
78
66
echo " (sent pushover failure notification)"
79
67
if which notify-send 2>&1 > /dev/null; then
80
68
notify-send " Command Failed" " failed in ${times} (exit $exitcode ): $@ (in $( pwd) )"
0 commit comments