jw-pkg/scripts/jannet

79 lines
1.3 KiB
Text
Raw Normal View History

#!/bin/sh
myname=`basename $0`
2007-09-03 20:12:01 +00:00
channel_present()
{
if smart channel --show $1 2>&1 | grep -q baseurl >/dev/null; then
return 0
fi
return 1
}
usage()
{
cat << EOT
2007-09-03 20:47:58 +00:00
$myname command [arguments]
command is one of
2007-09-03 20:47:58 +00:00
help: show this help screen
2007-09-03 20:12:01 +00:00
init: initialize
uninit: undo initialization
2007-09-03 20:47:58 +00:00
install: install packages in [arguments]
update: update all jannet software on the system
info: query information about installed software
EOT
if [ "$1" ]; then
exit $1
fi
}
2007-09-03 20:47:58 +00:00
cmd="$1"
shift
case $cmd in
2007-09-03 20:12:01 +00:00
init)
if ! channel_present ftp.jannet.de; then
echo -n "adding installation source ... "
sudo smart channel -y --add ftp.jannet.de \
type=yast2 \
baseurl=ftp://dspadm:dspasswd@ftp.jannet.de/pub/packages/linux/suse/10.1/inst-source \
>/dev/null 2>&1
if channel_present; then echo done; else echo failed; fi
fi
;;
2007-09-03 20:47:58 +00:00
2007-09-03 20:12:01 +00:00
uninit)
if channel_present ftp.jannet.de; then
echo -n "removing installation source ... "
sudo smart channel -y --remove ftp.jannet.de >/dev/null 2>&1
echo done
fi
;;
2007-09-03 20:47:58 +00:00
update)
sudo smart update ftp.jannet.de
sudo smart upgrade -y
;;
2007-09-03 20:47:58 +00:00
install)
sudo smart update ftp.jannet.de
sudo smart install -y $*
;;
info)
rpm -qai | grep -iB 7 "jannet.de\|c-mexx.com"
;;
2007-09-03 20:47:58 +00:00
help)
usage 0
;;
*)
usage 1
;;
2007-09-03 20:47:58 +00:00
esac