Ver código fonte

ghost download url

Bob Mottram 8 anos atrás
pai
commit
be5dd63e71
1 arquivos alterados com 8 adições e 6 exclusões
  1. 8
    6
      src/freedombone-app-ghost

+ 8
- 6
src/freedombone-app-ghost Ver arquivo

13
 # License
13
 # License
14
 # =======
14
 # =======
15
 #
15
 #
16
-# Copyright (C) 2016 Bob Mottram <bob@freedombone.net>
16
+# Copyright (C) 2016-2017 Bob Mottram <bob@freedombone.net>
17
 #
17
 #
18
 # This program is free software: you can redistribute it and/or modify
18
 # This program is free software: you can redistribute it and/or modify
19
 # it under the terms of the GNU Affero General Public License as published by
19
 # it under the terms of the GNU Affero General Public License as published by
36
 GHOST_DOMAIN_NAME=
36
 GHOST_DOMAIN_NAME=
37
 GHOST_CODE=
37
 GHOST_CODE=
38
 GHOST_ONION_PORT=8104
38
 GHOST_ONION_PORT=8104
39
-GHOST_VERSION='0.11.8'
40
 GHOST_PORT=2368
39
 GHOST_PORT=2368
40
+GHOST_VERSION='0.11.8'
41
+GHOST_DOWNLOAD_URL="https://github.com/TryGhost/Ghost/releases/download/${GHOST_VERSION}/Ghost-${GHOST_VERSION}.zip"
41
 
42
 
42
 ghost_variables=(GHOST_VERSION
43
 ghost_variables=(GHOST_VERSION
43
                  GHOST_DOMAIN_NAME
44
                  GHOST_DOMAIN_NAME
151
 
152
 
152
 function upgrade_ghost {
153
 function upgrade_ghost {
153
     if ! grep -q "ghost version:" $COMPLETION_FILE; then
154
     if ! grep -q "ghost version:" $COMPLETION_FILE; then
154
-        return
155
+        CURR_GHOST_VERSION=${GHOST_VERSION}b
156
+    else
157
+        CURR_GHOST_VERSION=$(get_completion_param "ghost version")
155
     fi
158
     fi
156
 
159
 
157
-    CURR_GHOST_VERSION=$(get_completion_param "ghost version")
158
     if [[ "$GHOST_VERSION" == "$CURR_GHOST_VERSION" ]]; then
160
     if [[ "$GHOST_VERSION" == "$CURR_GHOST_VERSION" ]]; then
159
         return
161
         return
160
     fi
162
     fi
164
     GHOST_PATH=/var/www/$GHOST_DOMAIN_NAME/htdocs
166
     GHOST_PATH=/var/www/$GHOST_DOMAIN_NAME/htdocs
165
 
167
 
166
     cd $GHOST_PATH
168
     cd $GHOST_PATH
167
-    wget https://ghost.org/zip/ghost-${GHOST_VERSION}.zip
169
+    wget ${GHOST_DOWNLOAD_URL}
168
     if [ ! -f ghost-${GHOST_VERSION}.zip ]; then
170
     if [ ! -f ghost-${GHOST_VERSION}.zip ]; then
169
         echo $'Unable to download ghost'
171
         echo $'Unable to download ghost'
170
         rm -rf /var/www/$GHOST_DOMAIN_NAME
172
         rm -rf /var/www/$GHOST_DOMAIN_NAME
365
         mkdir -p /var/www/$GHOST_DOMAIN_NAME/htdocs
367
         mkdir -p /var/www/$GHOST_DOMAIN_NAME/htdocs
366
     fi
368
     fi
367
     cd /var/www/$GHOST_DOMAIN_NAME/htdocs
369
     cd /var/www/$GHOST_DOMAIN_NAME/htdocs
368
-    wget https://ghost.org/zip/ghost-${GHOST_VERSION}.zip
370
+    wget ${GHOST_DOWNLOAD_URL}
369
     if [ ! -f ghost-${GHOST_VERSION}.zip ]; then
371
     if [ ! -f ghost-${GHOST_VERSION}.zip ]; then
370
         echo $'Unable to download ghost'
372
         echo $'Unable to download ghost'
371
         rm -rf /var/www/$GHOST_DOMAIN_NAME
373
         rm -rf /var/www/$GHOST_DOMAIN_NAME