#!/bin/sh set -e UPDATED_FILE="/opt/AdobeAirApp/Scratch 2/share/META-INF/AIR/application.xml" LAST_ORIG_VERSION="455" LAST_LLIUREX_VERSION="904" if [ ! -f "$UPDATED_FILE" ]; then exit 0 fi ACTUAL_VERSION=$(grep "" "$UPDATED_FILE" | cut -d ">" -f2 | cut -d "<" -f1); echo "Actual version is $ACTUAL_VERSION" ## Tienes una version anterior la Original de la web, asi que actualizamos if [ "$ACTUAL_VERSION" -lt "$LAST_ORIG_VERSION" ]; then #echo "Your version is obsolete, we are going to update it. wait please....." #/usr/share/zero-center/zmds/zero-lliurex-adobeair-scratch2.zmd #echo "Your Scratch 2 has been updated by LliureX, enjoy it" echo "" echo "-------------- SCRATCH IS OBSOLOTE-----------------" echo "Your Scratch version is obsolete, please update it from Zero-Center, and press Scratch button again." echo "" zenity --info --title="Zero-installer-Scratch" --text="Your Scratch version is obsolete, please update it from Zero-Center, and press Scratch button again." > /dev/null 2>&1 & #echo "Your Scratch 2 has been updated by LliureX, enjoy it" exit 0 ## Tienes la ultima version pero mal numerada, no coincide con el control de versiones de LLiureX elif [ "$ACTUAL_VERSION" = "$LAST_ORIG_VERSION" ]; then echo "You have the latest Scratch version" sed -i -e "s%$LAST_ORIG_VERSION<\/versionNumber>%$LAST_LLIUREX_VERSION<\/versionNumber>%g" "$UPDATED_FILE" exit 0 ## Si llegamos aqui es que tienes una version superior a las de la web de SCRATCH pero anterior a la LAST_LLIUREX_VERSION por lo que hemos de actualizarte elif [ "$ACTUAL_VERSION" != "$LAST_LLIUREX_VERSION" ]; then echo "" echo "-------------- SCRATCH IS OBSOLOTE-----------------" echo "Your Scratch version is obsolete, please update it from Zero-Center, and press Scratch button again." echo "" zenity --info --title="Zero-installer-Scratch" --text="Your Scratch version is obsolete, please update it from Zero-Center, and press Scratch button again." > /dev/null 2>&1 & exit 0 fi echo "Do nothing, you are updated" exit 0