Magellan Linux

Diff of /alx-src/branches/alxconf_20060908/bin/update-alx.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 289 by niro, Thu Aug 18 02:50:17 2005 UTC revision 374 by niro, Mon Feb 20 14:49:30 2006 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/bin/update-alx.sh,v 1.1 2005-08-18 02:50:17 niro Exp $  # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/bin/update-alx.sh,v 1.4 2006-02-20 14:49:30 niro Exp $
3    
4    die()
5    {
6     echo
7     echo "Error: $@. Update *not* successfull."
8     exit 1
9    }
10    
11  diskfree()  diskfree()
12  {  {
# Line 50  source /etc/alxconfig-ng/config.rc Line 57  source /etc/alxconfig-ng/config.rc
57    
58  # in kilobytes ! min 50MB are needed !!  # in kilobytes ! min 50MB are needed !!
59  MIN_SPACE=50000  MIN_SPACE=50000
60  SERVER_SHARE="//${SQL_HOST}/magetmp"  SERVER_SHARE="${SMB_UPDATE_HOST}"
61  USER="${SQL_USER}"  USER="${SMB_UPDATE_USER}"
62  PASS="${SQL_PASS}"  PASS="${SMB_UPDATE_PASS}"
63    
64    # setup mage.rc
65    sed -i -e "s@^\(MIRRORS=\).*@\1\"${MAGE_MIRRORS}\"@" \
66     -e "s@^\(RSYNC=\).*@\1\"${MAGE_RSYNC}\"@" \
67     /etc/mage.rc || die "fixing /etc/mage.rc"
68    
69  if [[ $(diskfree /) < ${MIN_SPACE} ]]; then  if [ $(diskfree /) -le ${MIN_SPACE} ]; then
70   echo "mounting server"   echo "Mounting server '${SERVER_SHARE}' ..."
71   # make a secure tmp dir   # make a secure tmp dir
72   if [ -x /bin/mktemp ]; then   if [ -x /bin/mktemp ]; then
73   TEMPDIR="$(/bin/mktemp -d)"   TEMPDIR="$(/bin/mktemp -d)"
# Line 74  if [[ $(diskfree /) < ${MIN_SPACE} ]]; t Line 86  if [[ $(diskfree /) < ${MIN_SPACE} ]]; t
86   mount -o bind ${TEMPDIR}/${HOSTNAME}/packages ${PKGDIR}   mount -o bind ${TEMPDIR}/${HOSTNAME}/packages ${PKGDIR}
87  fi  fi
88    
89  echo "running update"  echo "Running update ..."
90  # fetching new db  # fetching new db
91  mage update  
92    echo "Fetching mage database update ..."
93    mage update > /dev/null || die "mage update"
94    
95  ### demo hotfix###  ### demo hotfix###
96  #cp /usr/mage/profiles/alx-041/* /etc/mage-profile  #cp /usr/mage/profiles/alx-041/* /etc/mage-profile
# Line 90  mage update Line 104  mage update
104  mount /boot &> /dev/null  mount /boot &> /dev/null
105    
106  # first update mage  # first update mage
107  mage install mage-alx  mage install mage-alx || die "install mage"
108    
109  # than clean forcefully all packages that does not fit the profile  # than clean forcefully all packages that does not fit the profile
110  if [ -f /etc/mage-profile/forced-uninstall ]  if [ -f /etc/mage-profile/forced-uninstall ]
# Line 99  then Line 113  then
113  fi  fi
114    
115  # than update the whole system  # than update the whole system
116  mageupgrade --no-calc --autoclean --autoanswer #--debug  mageupgrade --no-calc --autoclean --autoanswer || die "system upgrade" #--debug
117    
118  # umount BUILDDIR  # umount BUILDDIR
119  if is_mounted ${BUILDDIR}; then  if is_mounted ${BUILDDIR}; then
# Line 119  fi Line 133  fi
133  if is_mounted ${TEMPDIR}; then  if is_mounted ${TEMPDIR}; then
134   umount_server   umount_server
135  fi  fi
136    
137    ### check mage version for 0.>4.x-rxx
138    #/sbin/mage version | egrep v0.[4-9].[0-9]-r??
139    

Legend:
Removed from v.289  
changed lines
  Added in v.374