Indice del forum www.zeroshell.net
Distribuzione Linux ZeroShell
 
 FAQFAQ   CercaCerca  GruppiGruppi   RegistratiRegistrati 
 ProfiloProfilo  Log inLog in   Messaggi privatiMessaggi privati 

Script upgrade beta15 -> beta16

 
Nuovo argomento   Rispondi    Indice del forum -> ZeroShell
Precedente :: Successivo  

Lo script ha funzionato?
Si
0%
 0%  [ 0 ]
No
0%
 0%  [ 0 ]
Voti Totali : 0

Autore Messaggio
xvince



Registrato: 12/03/10 18:17
Messaggi: 43
Residenza: L'Aquila

MessaggioInviato: Ven Set 23, 2011 8:54 am    Oggetto: Script upgrade beta15 -> beta16 Rispondi citando

Ho preparato questo script, per me ha funzionato.
Spero altrettanto per voi.

Vince

#!/bin/sh
. /etc/kerbynet.conf
############################################
# ZeroShell AutoUPGRADE by Massimiliano Cianelli
# Version 0.1 - 30-05-2009
# * First release
#
# Version 0.2 - 02-06-2009
# * Added check for /cdrom device
# * Added check for size and MD5 of downloaded file
# * Added check for 1.0beta11b version
# * Added check for /dev/shm needed space
#
# Version 0.3 - 15-06-2009
# * Added $instmnt and set it to /Database instead
# of the forced /dev/shm
#
# Version 0.3a - 28-08-2010
# * Fixed free space check, now check it in byte.
# In that way, it don't get error if read 4GB of free space.
# * Updated for upgrade from 1.0b12 to 1.0b13
#
# Version 0.3a - 18-01-2011
# * Updated for upgrade from 1.0b13 to 1.0b14
#
# Version 0.4 - 16-07-2011 (franzo15)
# * Updated for upgrade from 1.0b14 to 1.0b15
#
# Version 0.5 - 23-09-2011 (xvince)
# * Updated for upgrade from 1.0b15 to 1.0b16
#
############################################
# DO NOT EDIT ANYTHING IN THAT SECTION #
export upgold="1.0.beta15" # OLD VERSION
export upgnew="1.0.beta16" # NEW VERSION
export var=`$SCRIPTS/release`.`$SCRIPTS/patchlevel` # ACTUAL VERSION
export zsdev=`mount | grep cdrom | awk '{print $1}'` # CDROM DEVICE
export instmnt=/Database # INSTALLATION MountPoint
export instdev=`mount | grep $instmnt | awk '{print $1}'` # INSTALLATION Device
export instspace=`df | grep $instmnt | awk '{print $4}'` # Check free space
export instspacen=162000 # Space Needed in KB
############################################
# FILE MIRROR - EDIT IF YOU KNOW WHAT DO YOU DO
export iso="http://na.mirror.garr.it/mirrors/zeroshell/ZeroShell-$upgnew.iso"
export isosize="171569152"
export isomd5="93204d6fedabefa7408d3b27a24d73db"
############################################

echo "********************************************************"
echo "ZeroShell AutoUpgrade from $upgold to $upgnew"
echo "********************************************************"
echo "ZeroShell Version: $var"
echo "ZeroShell Drive: $zsdev"
echo "$instmnt FreeSpace/NeededSpace: $instspace/$instspacen"
echo ""
echo "Iso Mirror:"
echo $iso
echo "********************************************************"
echo "!!!! WARNING !!!!"
echo "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY."
echo "In no event shall I be liable for any damages resulting from the use of this program."
echo "********************************************************"
echo "I know that the author of that script is not liable for any damanges resulting from the use of this program:"
echo "(Write \"Accept\" for accept, or anything else for exit)"
read accept

if [ "$accept" != "Accept" ]; then
echo "Exiting..."
exit 0
fi

if [ "$var" != "$upgold" ]; then
if [ "$var" != "$upgoldb" ]; then
echo "This script is only for $upgold"
exit 1
fi
fi

if [ 0 = `mount | grep boot | wc -l` ]; then
echo "Sorry, no /boot found. Are you using the Alix\Soekris image file?"
exit 1
fi

if [ $instspacen -lt $instspace ]; then
echo "$instmnt FreeSpace: OK ($instspace/$instspacen)"
else
echo "$instmnt FreeSpace: KO.\n Needed $instspacen - Available: $instspace"
exit 1
fi

mkdir /$instmnt/upg-$upgnew
cd /$instmnt/upg-$upgnew

echo "Downloading ZeroShell $upgnew iso"
wget -O ZeroShell-$upgnew.iso -c $iso

echo "Checking downloaded file... "
if [ `ls -al ZeroShell-$upgnew.iso 2>>/dev/null| wc -l` != "1" ]; then
echo "Error: Something went wrong during the iso download - File not found."
exit 1
fi

if [ `ls -lrt ZeroShell-$upgnew.iso | awk '{print $5}'` != "$isosize" ]; then
echo "Error: Something went wrong during the iso download - Size mismatch."
echo "Please check it manually, it may be $isosize but is `ls -lrt ZeroShell-$upgnew.iso | awk '{print $5}'`"
exit 1
fi

if [ `md5sum ZeroShell-$upgnew.iso | awk '{print $1}'` != "$isomd5" ]; then
echo "Error: Something went wrong with ISO file - MD5 mismatch."
exit 1
fi

echo "Mounting ZeroShell iso"
mkdir cdrom
mount -o loop ZeroShell-$upgnew.iso cdrom/

echo "Changing /usr and /sbin"
rm -fr /usr /sbin
cdrom/usr/bin/ln -s /$instmnt/upg-$upgnew/cdrom/usr/ /usr
cdrom/usr/bin/ln -s /$instmnt/upg-$upgnew/cdrom/sbin/ /sbin

echo "Upgrading ZeroShell device ($zsdev)"
dd if=/$instmnt/upg-$upgnew/ZeroShell-$upgnew.iso of=$zsdev

echo ".:: The End ::."
echo "If you havent got any error message.. type reboot and push enter Smile"
Top
Profilo Invia messaggio privato
Mostra prima i messaggi di:   
Nuovo argomento   Rispondi    Indice del forum -> ZeroShell Tutti i fusi orari sono GMT + 1 ora
Pagina 1 di 1

 
Vai a:  
Non puoi inserire nuovi argomenti
Non puoi rispondere a nessun argomento
Non puoi modificare i tuoi messaggi
Non puoi cancellare i tuoi messaggi
Non puoi votare nei sondaggi


Powered by phpBB © 2001, 2005 phpBB Group
phpbb.it