www.zeroshell.org Forum Index www.zeroshell.org
Linux Distribution for server and embedded devices
 
 SearchSearch  RegisterRegister  UsergroupsUsergroups 
 ProfileProfile  Log inLog in  Log in to check your private messagesPrivate Message 

Upgrade from beta15 to beta16

 
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> ZeroShell
View previous topic :: View next topic  
Author Message
xvince



Joined: 29 Nov 2010
Posts: 2
Location: IT - L'Aquila

PostPosted: Fri Sep 23, 2011 8:02 am    Post subject: Upgrade from beta15 to beta16 Reply with quote

Hi everyone,
I just prepared this script for upgrade your beta15 install.
It works for me!

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"
Back to top
View user's profile Send private message
fadjar340



Joined: 31 Mar 2008
Posts: 30

PostPosted: Tue Oct 04, 2011 4:31 pm    Post subject: Reply with quote

it can be done with:

Code:

cd /Database
wget http://vps.tst-indonesia.com/zeroshell_b15tob16.sh
sh zeroshell_b15tob16.sh


Regards,
Fadjar T
Back to top
View user's profile Send private message Send e-mail
ilNebbioso



Joined: 31 Mar 2009
Posts: 21

PostPosted: Tue Apr 09, 2013 11:03 am    Post subject: Reply with quote

Hello, everybody.
I've uploded the Vince' script on my server and ran as ever.

But, this time I found a problem I cannot solve, after I've prompted "Accept". Please look here below.



Can you help?

Thank you!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> ZeroShell All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group