#!/bin/bash
# quick and dirty update for our products - to be run from cron_daily
# (c)2008 neXt (sorin@xxxxxxxx.com) under the terms of GNU GPL v2
export log=/var/log/update.log
source='--ftp-user=ftpuser --ftp-password=ftppasswd ftp://my.site/update.tar.bz2'
date > $log
if [ ! -d /var/spool/update ]; then
mkdir -p /var/spool/update 1>>$log 2>&1
fi
cd /var/spool/update 1>>$log 2>&1
var=`/usr/bin/wget -N -t 10 -w 60 --random-wait -a $log -v $source; echo $?`
if [ $var -eq 0 ]; then
ls -l --time-style=long-iso update.tar.bz2 > newupd
if [ ! -f oldupd ]; then
touch oldupd 1>>$log 2>&1
fi
grep -v -f oldupd newupd > updres.$$
if [ -s updres.$$ ]; then
/bin/tar -xjf update.tar.bz2 1>>$log 2>&1
/bin/sh update/execute 1>>$log 2>&1
/bin/rm -rf update 1>>$log 2>&1
else
/bin/echo "No newer update downloaded" >> $log
fi
/bin/mv -f newupd oldupd 1>>$log 2>&1
/bin/rm -f updres.* 1>>$log 2>&1
else
/bin/echo "Wget returned an error" >> $log
fi
unset log
exit 0
In the void is virtue, and no evil. Wisdom has existance, principle has existance, the Way has existance, spirit is nothingness.
Image
Search This Blog
Blog Archive
-
▼
2008
(13)
-
▼
September
(9)
- qd-update
- redir init scriptPosted by rain on August 29th, 20...
- antivirus replacementPosted by rain on June 24th, ...
- update Posted by rain on May 3rd, 2008 ei da, m...
- process_exchangePosted in by rain on December 1st,...
- getexch.plPosted in by rain on November 7th, 2007#...
- process_unixPosted by rain on October 18th, 2007#!...
- initsetupPosted by rain on September 18th, 2007#!/...
- despre fine-tuning in linux (part one)Posted by r...
-
▼
September
(9)
No comments:
Post a Comment