source: OpenRLabs-Git/deploy/rlabs-docker/web2py-rlabs/scripts/update-web2py.sh @ 42095c5

mainqndtest v1.1.1
Last change on this file since 42095c5 was 42bd667, checked in by David Fuertes <dfuertes@…>, 4 years ago

Historial Limpio

  • Property mode set to 100755
File size: 1.3 KB
Line 
1#!/bin/bash
2#
3#  update-web2py.sh
4#  2009-12-16
5#
6#  install in web2py/.. or web2py/ or web2py/scripts as update-web2py.sh
7#  make executable: chmod +x web2py.sh
8#
9#  save a snapshot of current web2py/ as web2py/../web2py-version.zip
10#  download the current stable version of web2py
11#  unzip downloaded version over web2py/
12#
13TARGET=web2py
14
15if [ ! -d $TARGET ]; then
16        # in case we're in web2py/
17        if [ -f ../$TARGET/VERSION ]; then
18                cd ..
19        # in case we're in web2py/scripts
20        elif [ -f ../../$TARGET/VERSION ]; then
21                cd ../..
22        fi
23fi
24read a VERSION c < $TARGET/VERSION
25SAVE=$TARGET-$VERSION
26URL=http://www.web2py.com/examples/static/web2py_src.zip
27
28ZIP=`basename $URL`
29SAVED=""
30
31#  Save a zip archive of the current version,
32#  but don't overwrite a previous save of the same version.
33#
34if [ -f $SAVE.zip ]; then
35        echo "Remove or rename $SAVE.zip first" >&2
36        exit 1
37fi
38if [ -d $TARGET ]; then
39        echo -n ">>Save old version: " >&2
40        cat $TARGET/VERSION >&2
41        zip -q -r $SAVE.zip $TARGET
42        SAVED=$SAVE.zip
43fi
44#
45#  Download the new version.
46#
47echo ">>Download latest web2py release:" >&2
48curl -O $URL
49#
50#  Unzip into web2py/
51#
52unzip -q -o $ZIP
53rm $ZIP
54echo -n ">>New version: " >&2
55cat $TARGET/VERSION >&2
56if [ "$SAVED" != "" ]; then
57        echo ">>Old version saved as $SAVED"
58fi
Note: See TracBrowser for help on using the repository browser.