Subversion Repositories SmartDukaan

Rev

Rev 4849 | Rev 5000 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4849 Rev 4853
Line 4... Line 4...
4
then
4
then
5
        echo "Usage: $0 <UPDATE|ROLLBACK>"
5
        echo "Usage: $0 <UPDATE|ROLLBACK>"
6
        exit 1
6
        exit 1
7
fi
7
fi
8
 
8
 
-
 
9
ACTION=$1
-
 
10
if [ $ACTION != "UPDATE" -a $ACTION != "ROLLBACK" ]
-
 
11
then
-
 
12
        echo "Wrong input"
-
 
13
        echo "Usage: $0 <UPDATE|ROLLBACK>"
-
 
14
        exit 1
-
 
15
fi
-
 
16
 
9
# resolve links - $0 may be a softlink
17
# resolve links - $0 may be a softlink
10
PRG="$0"
18
PRG="$0"
11
 
19
 
12
while [ -h "$PRG" ]; do
20
while [ -h "$PRG" ]; do
13
  ls=`ls -ld "$PRG"`
21
  ls=`ls -ld "$PRG"`
Line 37... Line 45...
37
touch ${LOGERR}
45
touch ${LOGERR}
38
exec 7>&2           # Link file descriptor #7 with stderr.
46
exec 7>&2           # Link file descriptor #7 with stderr.
39
                    # Saves stderr.
47
                    # Saves stderr.
40
exec 2> ${LOGERR}     # stderr replaced with file ${LOGERR}.
48
exec 2> ${LOGERR}     # stderr replaced with file ${LOGERR}.
41
 
49
 
42
ACTION="$1"
-
 
43
DEPLOYED_TIMESTAMP=`cat /catalog-dumps/current.timestamp`
50
DEPLOYED_TIMESTAMP=`cat /catalog-dumps/current.timestamp`
44
if [ $ACTION = "UPDATE" ]
51
if [ $ACTION = "UPDATE" ]
45
then
52
then
46
        LATEST_TIMESTAMP=`cat /catalog-dumps/latest.timestamp`
53
        LATEST_TIMESTAMP=`cat /catalog-dumps/latest.timestamp`
47
        if [ "$DEPLOYED_TIMESTAMP" = "$LATEST_TIMESTAMP" ]
54
        if [ "$DEPLOYED_TIMESTAMP" = "$LATEST_TIMESTAMP" ]