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/bash
DEBUG=0
curver=`curl -s http://linuxtrade.0catch.com/version.txt`
hasver=`rpm -q linuxtrade`
RPM="$curver.i386.rpm"
URL=http://linuxtrade.0catch.com/RPMS/$RPM
if [ "$DEBUG" != 0 ]; then
hasver=xxx
if [ "$DEBUG" = 2 ]; then
URL=http://tctraffic.0catch.com/anim-20020222-15.gif
fi
fi
if [ "$curver" = "$hasver" ]; then
xmessage "You have the latest version, $curver" &
exit 0
fi
if [ -x /usr/bin/redhat-install-packages ]; then
# New method in RH 8.0
xterm -geometry 80x10+300+200 \
-T "Download RPM $RPM" \
-e sh -c "curl -o/tmp/$RPM $URL \
|| (sleep 10; exit 1) \
&& redhat-install-packages /tmp/$RPM"
elif [ -x /usr/bin/gnorpm-auth ]; then
xterm -geometry 80x10+300+200 \
-T "Download RPM $RPM" \
-e sh -c "curl -o/tmp/$RPM $URL \
|| (sleep 10; exit 1) \
&& gnorpm-auth -qp /tmp/$RPM"
else
xterm -geometry 80x10+300+200 \
-T "Download and Install RPM $RPM" \
-e sh -c "curl -o/tmp/$RPM $URL \
&& echo -e \"\nRoot \c\" \
&& su -c \"rpm -U /tmp/$RPM\" \
|| (sleep 10; exit)"
fi
|