Magellan Linux

Diff of /alx-src/trunk/alxconfig-ng/bin/update-alx.sh

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

revision 307 by niro, Thu Aug 18 02:50:17 2005 UTC revision 308 by niro, Sun Aug 28 19:31:34 2005 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.2 2005-08-28 19:31:34 niro Exp $
3    
4    die()
5    {
6     echo
7     echo "Error: $@. Update *not* successfull."
8     exit 1
9    }
10    
11  diskfree()  diskfree()
12  {  {
# Line 54  SERVER_SHARE="//${SQL_HOST}/magetmp" Line 61  SERVER_SHARE="//${SQL_HOST}/magetmp"
61  USER="${SQL_USER}"  USER="${SQL_USER}"
62  PASS="${SQL_PASS}"  PASS="${SQL_PASS}"
63    
64  if [[ $(diskfree /) < ${MIN_SPACE} ]]; then  if [ $(diskfree /) -le ${MIN_SPACE} ]; then
65   echo "mounting server"   echo "Mounting server '${SERVER_SHARE}' ..."
66   # make a secure tmp dir   # make a secure tmp dir
67   if [ -x /bin/mktemp ]; then   if [ -x /bin/mktemp ]; then
68   TEMPDIR="$(/bin/mktemp -d)"   TEMPDIR="$(/bin/mktemp -d)"
# Line 74  if [[ $(diskfree /) < ${MIN_SPACE} ]]; t Line 81  if [[ $(diskfree /) < ${MIN_SPACE} ]]; t
81   mount -o bind ${TEMPDIR}/${HOSTNAME}/packages ${PKGDIR}   mount -o bind ${TEMPDIR}/${HOSTNAME}/packages ${PKGDIR}
82  fi  fi
83    
84  echo "running update"  echo "Running update ..."
85  # fetching new db  # fetching new db
86  mage update  
87    echo "Fetching mage database update ..."
88    mage update > /dev/null || die "mage update"
89    
90  ### demo hotfix###  ### demo hotfix###
91  #cp /usr/mage/profiles/alx-041/* /etc/mage-profile  #cp /usr/mage/profiles/alx-041/* /etc/mage-profile
# Line 90  mage update Line 99  mage update
99  mount /boot &> /dev/null  mount /boot &> /dev/null
100    
101  # first update mage  # first update mage
102  mage install mage-alx  mage install mage-alx || die "install mage"
103    
104  # than clean forcefully all packages that does not fit the profile  # than clean forcefully all packages that does not fit the profile
105  if [ -f /etc/mage-profile/forced-uninstall ]  if [ -f /etc/mage-profile/forced-uninstall ]
# Line 99  then Line 108  then
108  fi  fi
109    
110  # than update the whole system  # than update the whole system
111  mageupgrade --no-calc --autoclean --autoanswer #--debug  mageupgrade --no-calc --autoclean --autoanswer || die "system upgrade" #--debug
112    
113  # umount BUILDDIR  # umount BUILDDIR
114  if is_mounted ${BUILDDIR}; then  if is_mounted ${BUILDDIR}; then

Legend:
Removed from v.307  
changed lines
  Added in v.308