1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
#!/bin/sh -e
#DEBHELPER#
mkdir -p /usr/local/share/bedic || true
. /usr/share/debconf/confmodule
for x in x; do
[ ! -f /usr/local/share/bedic/bg_en.dat ] \
|| [ ! -f /usr/local/share/bedic/bg_en.dat ] \
|| break
db_get kbedic/download
[ "$RET" = true ] || break
# address=http://heanet.dl.sourceforge.net/kbedic/bedic-data-4.0.tar.gz
address=http://ftp1.sourceforge.net/kbedic/bedic-data-4.0.tar.gz
tmpdir=`mktemp -d`
if \
wget --continue --tries=1 --dns-timeout=20 --connect-timeout=20 --read-timeout=60 $address -O $tmpdir/bedic.tar.gz \
&& tar zxf $tmpdir/bedic.tar.gz -C $tmpdir/ \
&& [ -f $tmpdir/bedic-data-4.0/bg_en.dat ] \
&& [ -f $tmpdir/bedic-data-4.0/en_bg.dat ]
then
cp $tmpdir/bedic-data-4.0/bg_en.dat /usr/local/share/bedic/bg_en.dat
cp $tmpdir/bedic-data-4.0/en_bg.dat /usr/local/share/bedic/en_bg.dat
chown root: /usr/local/share/bedic/*
chmod 644 /usr/local/share/bedic/*
else
db_reset kbedic/failed_download
db_input medium kbedic/failed_download || true
db_go || true
fi
rm -r $tmpdir
done
# To be sure if necessary this question is asked next time the config
# script is executed. This command can not be used in the config script
# because otherwise the question will be asked twice -- during the
# pre-configuration phase and and when the postinst is run.
db_reset kbedic/download
exit 0
|