Upgrade from beta15 to beta16

Home Page Forums Network Management ZeroShell Upgrade from beta15 to beta16

This topic contains 1 reply, has 0 voices, and was last updated by  xvince 5 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #43127

    xvince
    Member

    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 AlixSoekris 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 :-)”

    #51962

    fadjar340
    Member

    it can be done with:


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

    Regards,
    Fadjar T

    #51963

    ilNebbioso
    Participant

    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!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.