mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
jannet: Add commands init and uninit
This commit is contained in:
parent
3f00484402
commit
b6d84aff8c
1 changed files with 27 additions and 0 deletions
|
|
@ -2,6 +2,14 @@
|
||||||
|
|
||||||
myname=`basename $0`
|
myname=`basename $0`
|
||||||
|
|
||||||
|
channel_present()
|
||||||
|
{
|
||||||
|
if smart channel --show $1 2>&1 | grep -q baseurl >/dev/null; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
cat << EOT
|
cat << EOT
|
||||||
|
|
@ -10,6 +18,8 @@ cat << EOT
|
||||||
|
|
||||||
command is one of
|
command is one of
|
||||||
|
|
||||||
|
init: initialize
|
||||||
|
uninit: undo initialization
|
||||||
update: update all jannet software on the system
|
update: update all jannet software on the system
|
||||||
|
|
||||||
EOT
|
EOT
|
||||||
|
|
@ -19,6 +29,23 @@ EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
|
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
|
||||||
|
;;
|
||||||
|
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
|
||||||
|
;;
|
||||||
update)
|
update)
|
||||||
sudo smart update ftp.jannet.de
|
sudo smart update ftp.jannet.de
|
||||||
sudo smart upgrade -y
|
sudo smart upgrade -y
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue