| 1 | #! /bin/sh |
| 2 | |
| 3 | frog -V |
| 4 | |
| 5 | if [ $? -ne 0 ] |
| 6 | then |
| 7 | echo "unable to execute frog. Is it installed?" |
| 8 | exit 1 |
| 9 | fi |
| 10 | |
| 11 | set `frog -V` |
| 12 | |
| 13 | confdir=$2 |
| 14 | |
| 15 | if ! test -d $confdir |
| 16 | then |
| 17 | echo "frog didn't return a valid config dir. Maybe an old version?" |
| 18 | exit 1 |
| 19 | fi |
| 20 | |
| 21 | cd $confdir |
| 22 | echo "entered frog config dir: " $confdir |
| 23 | |
| 24 | if test -e frog.cfg |
| 25 | then |
| 26 | last=`ls frog.cfg.* |sort -V | tail -1 ` |
| 27 | if [ "$last" = "" ] |
| 28 | then |
| 29 | cp frog.cfg frog.cfg.1 |
| 30 | echo "created a backup copy of 'frog.cfg' :: 'frog.cfg.1'" |
| 31 | else |
| 32 | # echo found $last |
| 33 | new=frog.cfg.`echo $last | awk -F \. {'print ++$3'}` |
| 34 | cp frog.cfg $new |
| 35 | echo "created a backup copy of 'frog.cfg' :: '$new'" |
| 36 | fi |
| 37 | fi |
| 38 | |
| 39 | echo "attempt to retrieve frog datafiles from http://ilk.uvt.nl/frog" |
| 40 | |
| 41 | \rm -f Frog*.gz |
| 42 | |
| 43 | wget http://ilk.uvt.nl/frog/Frog.mbdp-latest.tar.gz |
| 44 | |
| 45 | if [ $? -ne 0 ] |
| 46 | then |
| 47 | echo "unable to retrieve frog data, please inform us:" |
| 48 | echo "send an e-mail to [email protected]" |
| 49 | exit 1 |
| 50 | fi |
| 51 | |
| 52 | echo "unpacking: Frog.mbdp-latest.tar.gz" |
| 53 | tar zxf Frog.mbdp-latest.tar.gz |
| 54 | if [ $? -ne 0 ] |
| 55 | then |
| 56 | echo "unable to unpack frog data, do you have enough rights?" |
| 57 | exit 1 |
| 58 | fi |
| 59 | |
| 60 | echo "done" |
| 61 |