2017-12-27 03:53:53 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#/--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
|
|
|
# __ __ _ _____ _ _ __ __ _ _ _
|
|
|
|
# \ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
|
|
|
# \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
|
|
|
# \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
|
|
|
# \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
|
|
|
# \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
|
|
|
# | |
|
|
|
|
# |_|
|
|
|
|
#/-------------------------------------------------------------------------------------------------------------------------------/
|
|
|
|
#
|
|
|
|
# @author Llewellyn van der Merwe <https://github.com/Llewellynvdm>
|
|
|
|
# @copyright Copyright (C) 2016. All Rights Reserved
|
|
|
|
# @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
#
|
|
|
|
#/-----------------------------------------------------------------------------------------------------------------------------/
|
|
|
|
|
2017-12-28 21:44:23 +00:00
|
|
|
# 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; }
|
|
|
|
|
2017-12-27 03:53:53 +00:00
|
|
|
# get script path
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
VDMHOME=~/
|
|
|
|
|
|
|
|
# load notify
|
|
|
|
. "$DIR/notify.sh"
|
|
|
|
|
2017-12-27 14:55:23 +00:00
|
|
|
# load sms
|
|
|
|
. "$DIR/sms.sh"
|
|
|
|
|
2017-12-27 03:53:53 +00:00
|
|
|
# main function
|
|
|
|
function main () {
|
2017-12-28 20:48:51 +00:00
|
|
|
if (( "$allowEcho" == 1 )); then
|
|
|
|
echo ".................................[ Vast Development Method ]...................................."
|
|
|
|
echo "...========================================================================| www.vdm.io |====..."
|
|
|
|
echoTweak "Getting the current price of $Currency in $Target"
|
|
|
|
echo "...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..."
|
|
|
|
fi
|
2017-12-27 03:53:53 +00:00
|
|
|
# get the price value
|
|
|
|
value=$(get_Price "${API}${Currency}/${Target}")
|
2017-12-28 16:42:01 +00:00
|
|
|
# set send key
|
|
|
|
setSendKey
|
2017-12-27 03:53:53 +00:00
|
|
|
# set target values and perform action if only TargetValue given
|
|
|
|
if (( "$TargetBelowValue" == 0 && "$TargetAboveValue" == 0));
|
|
|
|
then
|
|
|
|
getTarget "$TargetValue" "$value" 'setAction'
|
|
|
|
fi
|
|
|
|
# set target values and perform action if TargetBelowValue given
|
|
|
|
if (( "$TargetAboveValue" != 0 ));
|
|
|
|
then
|
|
|
|
getTarget "$TargetAboveValue" "$value" 'setActionAbove'
|
|
|
|
fi
|
|
|
|
# set target values and perform action if TargetBelowValue given
|
|
|
|
if (( "$TargetBelowValue" != 0 ));
|
|
|
|
then
|
|
|
|
getTarget "$TargetBelowValue" "$value" 'setActionBelow'
|
|
|
|
fi
|
2017-12-28 20:48:51 +00:00
|
|
|
if (( "$allowEcho" == 1 )); then
|
|
|
|
echo "...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..."
|
|
|
|
fi
|
2017-12-28 16:42:01 +00:00
|
|
|
# send Messages
|
|
|
|
sendMessages
|
2017-12-28 20:48:51 +00:00
|
|
|
if (( "$allowEcho" == 1 )); then
|
|
|
|
echo "...==========================================================================================..."
|
|
|
|
echo "................................................................................................"
|
|
|
|
fi
|
2017-12-27 03:53:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getTarget() {
|
|
|
|
# set Args
|
|
|
|
local target_value="$1"
|
|
|
|
local current_value="$2"
|
|
|
|
local funcName="$3"
|
|
|
|
# do the work
|
|
|
|
if [[ "$target_value" == *,* ]] ; then
|
|
|
|
IFS=',' read -ra ADDR <<< "$target_value"
|
|
|
|
for tValue in "${ADDR[@]}"; do
|
|
|
|
# process "$tValue"
|
|
|
|
$funcName "$current_value" "$tValue"
|
|
|
|
done
|
|
|
|
else
|
|
|
|
$funcName "$current_value" "$target_value"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function setAction () {
|
|
|
|
# set Args
|
|
|
|
local current_value="$1"
|
|
|
|
local target_value="$2"
|
|
|
|
# should we do above
|
|
|
|
setActionAbove "$current_value" "$target_value"
|
|
|
|
# should we do below
|
|
|
|
setActionBelow "$current_value" "$target_value"
|
|
|
|
}
|
|
|
|
|
|
|
|
function setActionAbove () {
|
|
|
|
# set Args
|
|
|
|
local current_value="$1"
|
|
|
|
local target_value="$2"
|
|
|
|
# should we do above
|
|
|
|
if (( "$AboveValue" == 1 ));
|
|
|
|
then
|
|
|
|
# get action
|
|
|
|
local action=$(echo "$current_value > $target_value" | bc -l)
|
|
|
|
preform "$current_value" "$target_value" "$action" "above"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function setActionBelow () {
|
|
|
|
# set Args
|
|
|
|
local current_value="$1"
|
|
|
|
local target_value="$2"
|
|
|
|
# should we do below
|
|
|
|
if (( "$BelowValue" == 1 ));
|
|
|
|
then
|
|
|
|
# get action
|
|
|
|
local action=$(echo "$current_value < $target_value" | bc -l)
|
|
|
|
preform "$current_value" "$target_value" "$action" "below"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function preform () {
|
|
|
|
# set Args
|
|
|
|
local current_value="$1"
|
|
|
|
local target_value="$2"
|
|
|
|
local action="$3"
|
|
|
|
local target_type="$4"
|
|
|
|
# check if there is need of action
|
|
|
|
if (( "$action" == 1 ));
|
|
|
|
then
|
2017-12-28 16:42:01 +00:00
|
|
|
# set message since we are above target value
|
|
|
|
setMessage "$target_type" "$current_value" "$target_value"
|
2017-12-27 03:53:53 +00:00
|
|
|
else
|
2017-12-28 21:44:23 +00:00
|
|
|
echoTweak "${Currency} not ${target_type} ${target_value}${Target} at this time!"
|
2017-12-27 03:53:53 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2017-12-28 16:42:01 +00:00
|
|
|
# set message
|
|
|
|
function setMessage () {
|
2017-12-27 03:53:53 +00:00
|
|
|
# set Args
|
|
|
|
local target_type="$1"
|
|
|
|
local current_value="$2"
|
|
|
|
local target_value="$3"
|
|
|
|
# build message
|
2017-12-28 16:42:01 +00:00
|
|
|
message="${Currency} is ${target_type} ${target_value} ${Target} at ${current_value} ${Target}"
|
2017-12-27 03:53:53 +00:00
|
|
|
# first send to comand line
|
2017-12-28 19:41:10 +00:00
|
|
|
echoTweak "${message} - ${Datetimenow} "
|
|
|
|
# is it send time
|
2017-12-28 16:42:01 +00:00
|
|
|
sendTime "$target_type" "$target_value"
|
|
|
|
# set to messages
|
|
|
|
setMessages "$message" "$target_type" "$target_value"
|
2017-12-27 03:53:53 +00:00
|
|
|
}
|
|
|
|
|
2017-12-28 16:42:01 +00:00
|
|
|
# set messages
|
|
|
|
function setMessages () {
|
|
|
|
# set Args
|
|
|
|
local message="$1"
|
|
|
|
local type="$2"
|
|
|
|
local value="$3"
|
|
|
|
# check if we should set messages
|
|
|
|
if (( "$send" == 1 )); then
|
|
|
|
# we can set message
|
|
|
|
if [ "$type" == "below" ]; then
|
|
|
|
# set below message
|
|
|
|
belowMessages["$value"]="$message"
|
|
|
|
elif [ "$type" == "above" ]; then
|
|
|
|
# set above message
|
|
|
|
aboveMessages["$value"]="$message"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# send messages
|
|
|
|
function sendMessages () {
|
|
|
|
# filter messages to only send the lowest-below and the highest-above
|
|
|
|
filterMessages
|
|
|
|
# check if we have messages
|
|
|
|
if [ ${#Messages[@]} -gt 0 ]; then
|
|
|
|
# set to string
|
|
|
|
IFS=$'\n'
|
|
|
|
local messages="${Messages[*]}"
|
|
|
|
# send Telegram messages if allowed
|
|
|
|
sendTelegram "${messages}"
|
|
|
|
# show linux messages if allowed
|
|
|
|
showLinuxMessage "${messages}"
|
|
|
|
# send SMS messages if allowed
|
|
|
|
sendSMSMessage "${messages}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# filter messages to only send the lowest-below and the highest-above
|
|
|
|
function filterMessages () {
|
|
|
|
# check if lower value is found
|
|
|
|
if [ ${#belowMessages[@]} -gt 0 ]; then
|
|
|
|
# get lowest
|
|
|
|
activeKey=$( getActiveBelowMessages )
|
|
|
|
# set to messages
|
|
|
|
Messages+=("${belowMessages[$activeKey]}")
|
|
|
|
fi
|
|
|
|
# check if higher value is found
|
|
|
|
if [ ${#aboveMessages[@]} -gt 0 ]; then
|
|
|
|
# get highest
|
|
|
|
activeKey=$( getActiveAboveMessage )
|
|
|
|
# set to messages
|
|
|
|
Messages+=("${aboveMessages[$activeKey]}")
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# array sort
|
|
|
|
function getActiveBelowMessages () {
|
|
|
|
# start the search
|
|
|
|
local keys+=$(for i in "${!belowMessages[@]}"
|
|
|
|
do
|
|
|
|
echo $i
|
|
|
|
done | sort -n)
|
|
|
|
# return keys
|
|
|
|
echo $( echo "${keys}" | head -n1 )
|
|
|
|
}
|
|
|
|
|
|
|
|
# array sort
|
|
|
|
function getActiveAboveMessage () {
|
|
|
|
# start the search
|
|
|
|
local keys+=$(for i in "${!aboveMessages[@]}"
|
|
|
|
do
|
|
|
|
echo $i
|
|
|
|
done | sort -rn)
|
|
|
|
# return keys
|
|
|
|
echo $( echo "${keys}" | head -n1 )
|
|
|
|
}
|
|
|
|
|
2017-12-28 19:41:10 +00:00
|
|
|
# show message in linux (will not work on server)
|
2017-12-28 16:42:01 +00:00
|
|
|
function showLinuxMessage () {
|
2017-12-28 21:44:23 +00:00
|
|
|
# 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; }
|
2017-12-28 16:42:01 +00:00
|
|
|
# check if linux messages can be shown
|
|
|
|
if (( "$LinuxNotice" == 1 )); then
|
|
|
|
zenity --text="$1" --info 2> /dev/null
|
2017-12-28 19:41:10 +00:00
|
|
|
echoTweak "Linux Message was shown"
|
2017-12-28 16:42:01 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# send sms messages
|
|
|
|
function sendSMSMessage () {
|
|
|
|
# check if we should send SMS
|
|
|
|
if (( "$SMS" == 1 )); then
|
|
|
|
smsMe "${messages}"
|
2017-12-28 19:41:10 +00:00
|
|
|
echoTweak "SMS Message was send"
|
2017-12-28 16:42:01 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# send Telegram
|
|
|
|
function sendTelegram () {
|
|
|
|
# check if we should send Telegram
|
|
|
|
if (( "$Telegram" == 1 )); then
|
|
|
|
notifyMe "$1"
|
2017-12-28 19:41:10 +00:00
|
|
|
echoTweak "Telegram Message was send"
|
2017-12-28 16:42:01 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# check if it is time to show/send the messages
|
|
|
|
function sendTime () {
|
2017-12-27 03:53:53 +00:00
|
|
|
# set Args
|
|
|
|
local target_type="$1"
|
|
|
|
local target_value="$2"
|
2017-12-28 19:41:10 +00:00
|
|
|
# build key send time
|
2017-12-28 16:55:17 +00:00
|
|
|
keySendTime=$(echo -n "${target_type}${target_value}${sendKey}" | md5sum)
|
2017-12-28 16:42:01 +00:00
|
|
|
# check if we should send
|
|
|
|
if (( "$sendSwitch" == 2 ))
|
|
|
|
then
|
|
|
|
# send every time
|
|
|
|
send=1
|
|
|
|
elif grep -Fxq "$keySendTime" "$VDMHOME/.cointracker"
|
2017-12-27 03:53:53 +00:00
|
|
|
then
|
|
|
|
# Do not send notification (already send in time frame)
|
2017-12-28 16:42:01 +00:00
|
|
|
send=0
|
2017-12-27 03:53:53 +00:00
|
|
|
else
|
|
|
|
# add key to file
|
2017-12-28 16:42:01 +00:00
|
|
|
echo "$keySendTime" >> "$VDMHOME/.cointracker"
|
2017-12-27 03:53:53 +00:00
|
|
|
# send notification if asked to
|
2017-12-28 16:42:01 +00:00
|
|
|
send=1
|
2017-12-27 03:53:53 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-12-28 16:42:01 +00:00
|
|
|
# set the send key
|
|
|
|
function setSendKey () {
|
|
|
|
# what is the cycle of send time
|
|
|
|
if (( "$sendSwitch" == 1 ));
|
2017-12-27 03:53:53 +00:00
|
|
|
then
|
|
|
|
# once every hour
|
2017-12-28 16:42:01 +00:00
|
|
|
sendKey=$(TZ=":ZULU" date +"%m/%d/%Y (%H)" )
|
|
|
|
elif (( "$sendSwitch" == 3 ));
|
2017-12-27 03:53:53 +00:00
|
|
|
then
|
2017-12-28 16:42:01 +00:00
|
|
|
# show only once (ever)
|
|
|
|
sendKey="showOnce"
|
2017-12-27 03:53:53 +00:00
|
|
|
fi
|
|
|
|
# default (once per day)
|
2017-12-28 16:42:01 +00:00
|
|
|
# or send every time
|
2017-12-27 03:53:53 +00:00
|
|
|
}
|
|
|
|
|
2017-12-28 16:42:01 +00:00
|
|
|
# getting the price from CEX.io (API)
|
2017-12-27 03:53:53 +00:00
|
|
|
function get_Price () {
|
|
|
|
# get price from API
|
|
|
|
json=$(wget -q -O- "$1")
|
|
|
|
value=($( echo "$json" | jq -r '.lprice'))
|
|
|
|
echo "${value}"
|
|
|
|
}
|
|
|
|
|
2017-12-28 20:48:51 +00:00
|
|
|
# Some global defaults
|
2017-12-27 03:53:53 +00:00
|
|
|
Currency="BTC"
|
|
|
|
Target="USD"
|
|
|
|
TargetValue="17000"
|
|
|
|
TargetBelowValue=0
|
|
|
|
TargetAboveValue=0
|
2017-12-28 16:42:01 +00:00
|
|
|
sendKey=$(TZ=":ZULU" date +"%m/%d/%Y" )
|
2017-12-28 20:48:51 +00:00
|
|
|
allowEcho=1
|
2017-12-28 16:42:01 +00:00
|
|
|
send=0
|
2017-12-28 21:07:08 +00:00
|
|
|
sendSwitch=2
|
2017-12-27 03:53:53 +00:00
|
|
|
BelowValue=0
|
|
|
|
AboveValue=0
|
|
|
|
Telegram=0
|
|
|
|
LinuxNotice=0
|
2017-12-27 14:55:23 +00:00
|
|
|
SMS=0
|
2017-12-28 20:24:23 +00:00
|
|
|
|
2017-12-28 20:48:51 +00:00
|
|
|
# API URL
|
2017-12-27 03:53:53 +00:00
|
|
|
API="https://cex.io/api/last_price/"
|
|
|
|
|
2017-12-28 20:48:51 +00:00
|
|
|
# Some Messages arrays
|
2017-12-28 16:42:01 +00:00
|
|
|
declare -A aboveMessages
|
|
|
|
declare -A belowMessages
|
|
|
|
Messages=()
|
|
|
|
|
|
|
|
# use UTC+00:00 time also called zulu
|
|
|
|
Datetimenow=$(TZ=":ZULU" date +"%m/%d/%Y @ %R (UTC)" )
|
|
|
|
|
2017-12-27 03:53:53 +00:00
|
|
|
# Help display function
|
2017-12-28 20:24:23 +00:00
|
|
|
function show_help {
|
2017-12-27 03:53:53 +00:00
|
|
|
cat << EOF
|
|
|
|
Usage: ${0##*/:-} [OPTION...]
|
|
|
|
Getting Coin Value in Fiat Currency at set price
|
|
|
|
|
|
|
|
-c Currency to watch (c:_)
|
|
|
|
example: BTC
|
2017-12-28 20:24:23 +00:00
|
|
|
-C Target Currecy to Display (_:t)
|
2017-12-27 03:53:53 +00:00
|
|
|
example: USD
|
2017-12-28 20:24:23 +00:00
|
|
|
-h How often should the message be send/shown
|
2017-12-27 03:53:53 +00:00
|
|
|
0 = once per/day (default)
|
|
|
|
1 = once per/hour
|
|
|
|
2 = everyTime
|
|
|
|
3 = only once
|
2017-12-28 16:42:01 +00:00
|
|
|
-v Value (above or below) at which to send/send notice
|
2017-12-27 03:53:53 +00:00
|
|
|
example: 17000 or 14000,15000
|
2017-12-28 16:42:01 +00:00
|
|
|
-A Value Above at which to send notice
|
2017-12-27 03:53:53 +00:00
|
|
|
example: 17000 or 19000,18000
|
2017-12-28 16:42:01 +00:00
|
|
|
-B Value Below at which to send notice
|
2017-12-27 03:53:53 +00:00
|
|
|
example: 14000 or 14000,15000
|
|
|
|
-b Send Notice below target value once a day
|
|
|
|
-a Send Notice above target value once a day (default)
|
2017-12-28 20:48:51 +00:00
|
|
|
-q Quiet - Turn off terninal output
|
|
|
|
-t Send A Telegram Notice
|
|
|
|
-s Send A SMS Notice
|
2017-12-28 21:44:23 +00:00
|
|
|
-l Show A Linux Notice via zenity
|
2017-12-27 03:53:53 +00:00
|
|
|
|
|
|
|
EOF
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
# getopts howtos: (mainly for me)
|
|
|
|
# http://www.theunixschool.com/2012/08/getopts-how-to-pass-command-line-options-shell-script-Linux.html
|
|
|
|
# http://mywiki.wooledge.org/BashFAQ/035
|
|
|
|
# http://wiki.bash-hackers.org/howto/getopts_tutorial
|
|
|
|
|
2017-12-28 20:48:51 +00:00
|
|
|
while getopts ":c:C:h:v:A:B:b :a :t :s :q :l :" opt; do
|
2017-12-27 03:53:53 +00:00
|
|
|
case $opt in
|
|
|
|
c)
|
|
|
|
Currency=$OPTARG
|
|
|
|
;;
|
2017-12-28 20:24:23 +00:00
|
|
|
C)
|
2017-12-27 03:53:53 +00:00
|
|
|
Target=$OPTARG
|
|
|
|
;;
|
2017-12-28 20:24:23 +00:00
|
|
|
h)
|
2017-12-28 16:42:01 +00:00
|
|
|
sendSwitch=$OPTARG
|
2017-12-27 03:53:53 +00:00
|
|
|
;;
|
|
|
|
v)
|
|
|
|
TargetValue=$OPTARG
|
|
|
|
;;
|
|
|
|
B)
|
|
|
|
TargetBelowValue=$OPTARG
|
|
|
|
;;
|
|
|
|
A)
|
|
|
|
TargetAboveValue=$OPTARG
|
|
|
|
;;
|
|
|
|
b)
|
|
|
|
BelowValue=1
|
|
|
|
;;
|
|
|
|
a)
|
|
|
|
AboveValue=1
|
|
|
|
;;
|
2017-12-28 20:48:51 +00:00
|
|
|
q)
|
|
|
|
allowEcho=0
|
|
|
|
;;
|
2017-12-28 20:24:23 +00:00
|
|
|
t)
|
2017-12-27 03:53:53 +00:00
|
|
|
Telegram=1
|
|
|
|
;;
|
2017-12-28 20:24:23 +00:00
|
|
|
s)
|
2017-12-27 14:55:23 +00:00
|
|
|
SMS=1
|
|
|
|
;;
|
2017-12-27 03:53:53 +00:00
|
|
|
l)
|
|
|
|
LinuxNotice=1
|
|
|
|
;;
|
|
|
|
\?)
|
|
|
|
echo "Invalid option: -$OPTARG" >&2
|
|
|
|
echo
|
|
|
|
show_help
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
# little echo tweak
|
|
|
|
function echoTweak () {
|
2017-12-28 20:48:51 +00:00
|
|
|
if (( "$allowEcho" == 1 )); then
|
|
|
|
echoMessage="$1"
|
|
|
|
chrlen="${#echoMessage}"
|
|
|
|
if [ $# -eq 2 ]
|
|
|
|
then
|
|
|
|
mainlen="$2"
|
|
|
|
else
|
|
|
|
mainlen=70
|
|
|
|
fi
|
|
|
|
increaseBy=$((20+mainlen-chrlen))
|
|
|
|
tweaked=$(repeat "$increaseBy")
|
|
|
|
echo ".... $echoMessage $tweaked"
|
|
|
|
fi
|
2017-12-27 03:53:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# little repeater
|
|
|
|
function repeat () {
|
|
|
|
head -c $1 < /dev/zero | tr '\0' '\056'
|
|
|
|
}
|
|
|
|
|
|
|
|
# make sure the tracker file is set
|
|
|
|
if [ ! -f "$VDMHOME/.cointracker" ]
|
|
|
|
then
|
|
|
|
> "$VDMHOME/.cointracker"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Run the script
|
|
|
|
main
|