fixed urls in swapupdate.sh

This commit is contained in:
Russ Long 2015-03-30 19:31:20 -04:00
parent 031a43c717
commit a6a2671bec

View File

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
#this script is run via cron and checks for updates to swapwatch #this script is run via cron and checks for updates to swapwatch
#unless the conf says not to #unless the conf says not to
swapURL="http://DOMAIN.com/monitoring/swapwatch.sh" swapURL="http://DOMAIN.com/swapwatch.sh"
swapupdateURL="http://DOMAIN.com/monitoring/swapupdate.sh" swapupdateURL="http://DOMAIN.com/swapupdate.sh"
APPDIR="/usr/local/sw/apps/swapwatch" APPDIR="/usr/local/sw/apps/swapwatch"
TMPDIR="/usr/local/sw/temp" TMPDIR="/usr/local/sw/temp"
LOGDIR="/usr/local/sw/logs" LOGDIR="/usr/local/sw/logs"
@ -10,14 +10,14 @@ LOGDIR="/usr/local/sw/logs"
################################################################################ ################################################################################
#if we are allowed to update #if we are allowed to update
if [ $update = "yes" ] if [ $update = "yes" ]
then then
#update swapwatch.sh #update swapwatch.sh
wget -O "$TMPDIR/swapwatch.tmp" $swapURL wget -O "$TMPDIR/swapwatch.tmp" $swapURL
#only overwrite if the dl worked #only overwrite if the dl worked
if [ "$?" -eq 0 ] if [ "$?" -eq 0 ]
then then
#just overwrite... probably with identical data. that's fine #just overwrite... probably with identical data. that's fine
mv -f "$TMPDIR/swapwatch.tmp" "$APPDIR/swapwatch.sh" mv -f "$TMPDIR/swapwatch.tmp" "$APPDIR/swapwatch.sh"
chmod +x "$APPDIR/swapwatch.sh" chmod +x "$APPDIR/swapwatch.sh"