-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathterminal-notifier.sh
executable file
·52 lines (38 loc) · 1.26 KB
/
terminal-notifier.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
50
51
52
#!/bin/bash
# This script was developed BY Stony River Technologies (SRT)
# ALL scripts are covered by SRT's License found at:
# https://raw.github.com/stonyrivertech/SRT-Public/master/LICENSE
# Created by Justin Rummel
# Version 1.0.0 - 3/06/2013
# Modified by
# Version
### Description
# Goal is install terminal-notifier zipped binary from their git repo.
# Base Variables that I use for all scripts. Creates Log files and sets date/time info
declare -x SCRIPTPATH="${0}"
declare -x RUNDIRECTORY="${0%/*}"
declare -x SCRIPTNAME="${0##*/}"
logtag="${0##*/}"
debug_log="enable"
logDate=`date +"% Y.% m.% d"`
logDateTime=`date +"% Y.% m.06_% H-% M-% S"`
log_dir="/Library/Logs/${logtag}"
LogFile="${logtag}-${logDate}.log"
# Script Variables
tn="terminal-notifier_1.4.2.zip"
dl="https://github.com/downloads/alloy/terminal-notifier/${tn}"
tnHash="b5bc814b4872c9e381390d4fe11ad367"
dest="/Applications/"
# Script Functions
download () {
cd /tmp
curl -OL "${dl}"
}
unzipTN () {
cd /tmp
hash=`openssl md5 /tmp/"${tn}" | awk -F "= " '{print $2}'`
[ "${hash}" == "${tnHash}" ] && { unzip "${tn}"; mv /tmp/terminal-notifier_1.4.2/terminal-notifier.app "${dest}"; } || { logger "hash ${hash} did not match ${tnHash}. Stopping now."; exit 1; }
}
download
unzipTN
exit 0