set VER=3
set REV=8
version >NIL: path/to/wayfarer version $VER revision $REV
if warn
echo "Wayfarer is older than $VER.$REV"
else
echo "Wayfarer is version $VER.$REV or newer"
endif
cd ram:
set VER=3
set REV=8
version >NIL: sys:Applications/Wayfarer/Wayfarer version $VER revision $REV
if warn
wget --no-check-certificate https://www.morphos-storage.net/network/web/wayfarer.install
execute wayfarer.install
else
echo "You have the last version of Wayfarer installed"
ENDIF
; Set files here, no need to modify rest of the code then:
Set LOCALFILE "SYS:Applications/Wayfarer/Wayfarer"
Set REMOTEURL "https://jpv.amigaaa.com/"
Set REMOTEFILE "wayserver.version"
; Examples for testing newer and older version strings:
;Set REMOTEFILE "wayserver.version_old"
;Set REMOTEFILE "wayserver.version_new"
; If the wayfarer.install file would include a version string (no need for a separate version file):
;Set REMOTEURL "https://www.morphos-storage.net/network/web/"
;Set REMOTEFILE "wayfarer.install"
; The actual script:
FailAt 21 ; Don't stop execution on fails, but handle them in the script.
wget -q --no-check-certificate -O "RAM:$REMOTEFILE" $REMOTEURL$REMOTEFILE
Newer "$LOCALFILE" "RAM:$REMOTEFILE"
Set NEWRC $RC
If $NEWRC EQ 5
Echo "Remote is newer!"
Else
If $NEWRC GE 10
Echo "Can't check the version!"
Else
Echo "Remote is not newer."
EndIf
EndIf
Unset NEWRC
Unset REMOTEFILE
Unset REMOTEURL
Unset LOCALFILE