1
0
mirror of https://github.com/Llewellynvdm/CoinRate.git synced 2024-11-28 13:06:28 +00:00

Added some more prep to insure all needed commands are installed, before running the script

This commit is contained in:
Llewellyn van der Merwe 2017-12-28 23:44:23 +02:00
parent d6655f7f12
commit a30a3395a0
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5

View File

@ -16,6 +16,10 @@
# #
#/-----------------------------------------------------------------------------------------------------------------------------/ #/-----------------------------------------------------------------------------------------------------------------------------/
# Do some prep work
command -v jq >/dev/null 2>&1 || { echo >&2 "We require jq for this script to run, but it's not installed. Aborting."; exit 1; }
command -v curl >/dev/null 2>&1 || { echo >&2 "We require curl for this script to run, but it's not installed. Aborting."; exit 1; }
# get script path # get script path
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
VDMHOME=~/ VDMHOME=~/
@ -129,7 +133,7 @@ function preform () {
# set message since we are above target value # set message since we are above target value
setMessage "$target_type" "$current_value" "$target_value" setMessage "$target_type" "$current_value" "$target_value"
else else
echoTweak "Nothing to report at this time! ($target_value) " echoTweak "${Currency} not ${target_type} ${target_value}${Target} at this time!"
fi fi
} }
@ -228,6 +232,8 @@ function getActiveAboveMessage () {
# show message in linux (will not work on server) # show message in linux (will not work on server)
function showLinuxMessage () { function showLinuxMessage () {
# do some prep
command -v zenity >/dev/null 2>&1 || { echoTweak "We require zenity to show linux notice, but it's not installed."; LinuxNotice=0; }
# check if linux messages can be shown # check if linux messages can be shown
if (( "$LinuxNotice" == 1 )); then if (( "$LinuxNotice" == 1 )); then
zenity --text="$1" --info 2> /dev/null zenity --text="$1" --info 2> /dev/null
@ -355,7 +361,7 @@ Getting Coin Value in Fiat Currency at set price
-q Quiet - Turn off terninal output -q Quiet - Turn off terninal output
-t Send A Telegram Notice -t Send A Telegram Notice
-s Send A SMS Notice -s Send A SMS Notice
-l Show A Linux Notice -l Show A Linux Notice via zenity
EOF EOF
exit 1 exit 1