Przeglądaj źródła

Remove directories on failure

Bob Mottram 8 lat temu
rodzic
commit
ab5e6e2aa4
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3
    0
      src/freedombone-app-ghost

+ 3
- 0
src/freedombone-app-ghost Wyświetl plik

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