Public domain
#!/bin/bash
URL="http://slackware.at/data/slackware-12.1/"
DIRS="a ap d e f k kde l n t tcl x xap y"
YEL='\E[1;33m'
BLU='\E[1;34m'
RES='\E[0m'
for DIR in ${DIRS};do
echo -e "${BLU}* Checking ${URL}/slackware/${DIR}/${RES}"
PKGS=$(links -dump "${URL}/slackware/${DIR}/" |\
grep '\.tgz ' |\
sed -e 's,^ *,,' |\
sed -e 's, .*,,' )
for PKG in $PKGS; do
if [ "$PKG" != "" ]; then
NAME=$(echo $PKG | sed -e 's,\.tgz$,,')
ls /var/log/packages/${NAME} &> /dev/null
if [ "$?" == "2" ]; then
echo -e "${YEL}$NAME not installed, start downloading ${PKG} ${RES}"
mkdir -p ${DIR}
wget -P ${DIR} -c "${URL}/slackware/${DIR}/${PKG}"
fi
fi
done
done
BY: Pejman Moghadam
TAG: package-management, bash-script, bash
DATE: 2011-06-19 22:02:48