Browse Source

Remove directories on failure

Bob Mottram 8 years ago
parent
commit
ab5e6e2aa4
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      src/freedombone-app-ghost

+ 3
- 0
src/freedombone-app-ghost View File

291
     wget https://ghost.org/zip/ghost-${GHOST_VERSION}.zip
291
     wget https://ghost.org/zip/ghost-${GHOST_VERSION}.zip
292
     if [ ! -f ghost-${GHOST_VERSION}.zip ]; then
292
     if [ ! -f ghost-${GHOST_VERSION}.zip ]; then
293
         echo $'Unable to download ghost'
293
         echo $'Unable to download ghost'
294
+        rm -rf /var/www/$GHOST_DOMAIN_NAME
294
         exit 63892
295
         exit 63892
295
     fi
296
     fi
296
     unzip ghost-${GHOST_VERSION}.zip
297
     unzip ghost-${GHOST_VERSION}.zip
297
     if [ ! -f /var/www/${GHOST_DOMAIN_NAME}/htdocs/index.js ]; then
298
     if [ ! -f /var/www/${GHOST_DOMAIN_NAME}/htdocs/index.js ]; then
298
         echo $'ghost failed to unzip'
299
         echo $'ghost failed to unzip'
300
+        rm -rf /var/www/$GHOST_DOMAIN_NAME
299
         exit 63835
301
         exit 63835
300
     fi
302
     fi
301
 
303
 
307
     if [ ! "$?" = "0" ]; then
309
     if [ ! "$?" = "0" ]; then
308
         function_check remove_nodejs
310
         function_check remove_nodejs
309
         remove_nodejs ghost
311
         remove_nodejs ghost
312
+        rm -rf /var/www/$GHOST_DOMAIN_NAME
310
         echo $'Failed to install ghost'
313
         echo $'Failed to install ghost'
311
         exit 7383563
314
         exit 7383563
312
     fi
315
     fi