Bob Mottram 8 years ago
parent
commit
68ed1a81df

+ 3
- 2
src/freedombone-app-blog View File

@@ -180,9 +180,10 @@ function reconfigure_blog {
180 180
 }
181 181
 
182 182
 function upgrade_blog {
183
-    if ! grep -Fxq "install_blog" $COMPLETION_FILE; then
184
-        return
183
+    if grep -q "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then
184
+        FULLBLOG_DOMAIN_NAME=$(grep "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
185 185
     fi
186
+
186 187
     function_check set_repo_commit
187 188
     set_repo_commit /var/www/$FULLBLOG_DOMAIN_NAME/htdocs "Blog commit" "$FULLBLOG_COMMIT" $FULLBLOG_REPO
188 189
 

+ 2
- 2
src/freedombone-app-gnusocial View File

@@ -222,8 +222,8 @@ function reconfigure_gnusocial {
222 222
 }
223 223
 
224 224
 function upgrade_gnusocial {
225
-    if ! grep -Fxq "install_gnusocial_main" $COMPLETION_FILE; then
226
-        return
225
+    if grep -q "GNU Social domain" $COMPLETION_FILE; then
226
+        MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | head -n 1 | awk -F ':' '{print $2}')
227 227
     fi
228 228
 
229 229
     # update to the next commit

+ 0
- 4
src/freedombone-app-gogs View File

@@ -183,10 +183,6 @@ function reconfigure_gogs {
183 183
 }
184 184
 
185 185
 function upgrade_gogs {
186
-    if ! grep -Fxq "install_gogs" $COMPLETION_FILE; then
187
-        return
188
-    fi
189
-
190 186
     if ! grep -q "Gogs version:" $COMPLETION_FILE; then
191 187
         return
192 188
     fi

+ 3
- 2
src/freedombone-app-hubzilla View File

@@ -250,9 +250,10 @@ function reconfigure_hubzilla {
250 250
 }
251 251
 
252 252
 function upgrade_hubzilla {
253
-    if ! grep -Fxq "install_hubzilla" $COMPLETION_FILE; then
254
-        return
253
+    if grep -q "HUBZILLA_DOMAIN_NAME" $CONFIGURATION_FILE; then
254
+        HUBZILLA_DOMAIN_NAME=$(grep "HUBZILLA_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
255 255
     fi
256
+
256 257
     HUBZILLA_PATH=/var/www/$HUBZILLA_DOMAIN_NAME/htdocs
257 258
 
258 259
     function_check set_repo_commit

+ 2
- 2
src/freedombone-app-ipfs View File

@@ -54,7 +54,7 @@ function reconfigure_ipfs {
54 54
 }
55 55
 
56 56
 function upgrade_ipfs_go {
57
-    if ! grep -Fxq "install_ipfs_go" $COMPLETION_FILE; then
57
+    if [[ $(app_is_installed ipfs_go) == "0" ]]; then
58 58
         return
59 59
     fi
60 60
 
@@ -63,7 +63,7 @@ function upgrade_ipfs_go {
63 63
 }
64 64
 
65 65
 function upgrade_ipfs_js {
66
-    if ! grep -Fxq "install_ipfs_js" $COMPLETION_FILE; then
66
+    if [[ $(app_is_installed ipfs_js) == "0" ]]; then
67 67
         return
68 68
     fi
69 69
 

+ 2
- 2
src/freedombone-app-irc View File

@@ -186,7 +186,7 @@ function configure_firewall_for_irc {
186 186
 }
187 187
 
188 188
 function install_irc_server {
189
-    if grep -Fxq "install_irc_server" $COMPLETION_FILE; then
189
+    if [[ $(app_is_installed irc_server) == "1" ]]; then
190 190
         return
191 191
     fi
192 192
     apt-get -y install ngircd
@@ -293,7 +293,7 @@ function install_irc_server {
293 293
 }
294 294
 
295 295
 function install_irc_client {
296
-    if grep -Fxq "install_irc_client" $COMPLETION_FILE; then
296
+    if [[ $(app_is_installed irc_client) == "1" ]]; then
297 297
         return
298 298
     fi
299 299
     apt-get -y install irssi

+ 0
- 4
src/freedombone-app-librevault View File

@@ -51,10 +51,6 @@ function reconfigure_librevault {
51 51
 }
52 52
 
53 53
 function upgrade_librevault {
54
-    if ! grep -Fxq "install_librevault" $COMPLETION_FILE; then
55
-        return
56
-    fi
57
-
58 54
     function_check set_repo_commit
59 55
 
60 56
     if [ -d $INSTALL_DIR/protobuf ]; then

+ 0
- 4
src/freedombone-app-searx View File

@@ -51,10 +51,6 @@ function reconfigure_searx {
51 51
 }
52 52
 
53 53
 function upgrade_searx {
54
-    if ! grep -Fxq "install_searx" $COMPLETION_FILE; then
55
-        return
56
-    fi
57
-
58 54
     set_repo_commit $SEARX_PATH/searx "Search engine commit" "$SEARX_COMMIT" $SEARX_REPO
59 55
     if grep "Search engine key" $COMPLETION_FILE; then
60 56
         if [ -f ${SEARX_PATH}/searx/searx/settings.yml ]; then

+ 4
- 4
src/freedombone-app-sip View File

@@ -221,7 +221,7 @@ function update_sipwitch_daemon {
221 221
 }
222 222
 
223 223
 function install_sip_main {
224
-    if grep -Fxq "install_sip_main" $COMPLETION_FILE; then
224
+    if [[ $(app_is_installed sip_main) == "1" ]]; then
225 225
         return
226 226
     fi
227 227
 
@@ -301,11 +301,11 @@ function install_sip_main {
301 301
 
302 302
     function_check configure_firewall_for_sip4
303 303
     configure_firewall_for_sip4
304
-    echo 'install_sip_main' >> $COMPLETION_FILE
304
+    install_completed sip_main
305 305
 }
306 306
 
307 307
 function install_sip_turn {
308
-    if grep -Fxq "install_sip_turn" $COMPLETION_FILE; then
308
+    if [[ $(app_is_installed sip_turn) == "1" ]]; then
309 309
         return
310 310
     fi
311 311
 
@@ -442,7 +442,7 @@ function install_sip_turn {
442 442
 
443 443
     function_check configure_firewall_for_voip_turn
444 444
     configure_firewall_for_voip_turn
445
-    echo 'install_sip_turn' >> $COMPLETION_FILE
445
+    install_completed sip_turn
446 446
 }
447 447
 
448 448
 function install_sip {

+ 4
- 7
src/freedombone-app-tox View File

@@ -105,9 +105,6 @@ function reconfigure_tox {
105 105
 }
106 106
 
107 107
 function upgrade_tox {
108
-    if ! grep -Fxq "install_tox" $COMPLETION_FILE; then
109
-        return
110
-    fi
111 108
     function_check set_repo_commit
112 109
     set_repo_commit $INSTALL_DIR/toxcore "toxcore commit" "$TOXCORE_COMMIT" $TOXCORE_REPO
113 110
 
@@ -316,7 +313,7 @@ function tox_avahi {
316 313
 }
317 314
 
318 315
 function install_tox_node {
319
-    if grep -Fxq "install_tox_node" $COMPLETION_FILE; then
316
+    if [[ $(app_is_installed tox_node) == "1" ]]; then
320 317
         return
321 318
     fi
322 319
 
@@ -355,18 +352,18 @@ function install_tox_node {
355 352
 
356 353
     function_check configure_firewall_for_tox
357 354
     configure_firewall_for_tox
358
-    echo 'install_tox_node' >> $COMPLETION_FILE
355
+    install_completed tox_node
359 356
 }
360 357
 
361 358
 function install_tox_client {
362
-    if grep -Fxq "install_tox_client" $COMPLETION_FILE; then
359
+    if [[ $(app_is_installed tox_client) == "1" ]]; then
363 360
         return
364 361
     fi
365 362
 
366 363
     function_check mesh_tox_client
367 364
     mesh_tox_client
368 365
 
369
-    echo 'install_tox_client' >> $COMPLETION_FILE
366
+    install_completed tox_client
370 367
 }
371 368
 
372 369
 function mesh_tox_node {

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

@@ -76,9 +76,6 @@ function reconfigure_webmail {
76 76
 }
77 77
 
78 78
 function upgrade_webmail {
79
-    if ! grep -Fxq "install_webmail" $COMPLETION_FILE; then
80
-        return
81
-    fi
82 79
     function_check set_repo_commit
83 80
     set_repo_commit $WEBMAIL_PATH "Webmail commit" "$WEBMAIL_COMMIT" $WEBMAIL_REPO
84 81
 }

+ 4
- 7
src/freedombone-app-xmpp View File

@@ -117,9 +117,6 @@ function update_prosody_modules {
117 117
 }
118 118
 
119 119
 function upgrade_xmpp {
120
-    if ! grep -Fxq "install_xmpp_main" $COMPLETION_FILE; then
121
-        return
122
-    fi
123 120
     function_check update_prosody_modules
124 121
     update_prosody_modules
125 122
 }
@@ -259,7 +256,7 @@ function xmpp_email_headers {
259 256
 function install_xmpp_main {
260 257
     update_prosody_modules
261 258
 
262
-    if grep -Fxq "install_xmpp_main" $COMPLETION_FILE; then
259
+    if [[ $(app_is_installed xmpp_main) == "1" ]]; then
263 260
         return
264 261
     fi
265 262
     apt-get -y install lua-sec lua-bitop
@@ -431,11 +428,11 @@ function install_xmpp_main {
431 428
     configure_firewall_for_xmpp
432 429
     xmpp_email_headers
433 430
 
434
-    echo 'install_xmpp_main' >> $COMPLETION_FILE
431
+    install_completed xmpp_main
435 432
 }
436 433
 
437 434
 function install_xmpp_client {
438
-    if grep -Fxq "install_xmpp_client" $COMPLETION_FILE; then
435
+    if [[ $(app_is_installed xmpp_client) == "1" ]]; then
439 436
         return
440 437
     fi
441 438
     apt-get -y install profanity
@@ -498,7 +495,7 @@ function install_xmpp_client {
498 495
     chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.local
499 496
     chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.config
500 497
 
501
-    echo 'install_xmpp_client' >> $COMPLETION_FILE
498
+    install_completed xmpp_client
502 499
 }
503 500
 
504 501
 function install_xmpp {

+ 8
- 10
src/freedombone-app-zeronet View File

@@ -62,9 +62,6 @@ function reconfigure_zeronet {
62 62
 }
63 63
 
64 64
 function upgrade_zeronet {
65
-    if ! grep -Fxq "install_zeronet" $COMPLETION_FILE; then
66
-        return
67
-    fi
68 65
     function_check set_repo_commit
69 66
     set_repo_commit $MESH_INSTALL_DIR/zeronet "ZeroNet commit" "$ZERONET_COMMIT" $ZERONET_REPO
70 67
     set_repo_commit $MESH_INSTALL_DIR/zeronet/ZeroBlog "ZeroNet Blog commit" "$ZERONET_BLOG_COMMIT" $ZERONET_BLOG_REPO
@@ -159,7 +156,7 @@ function configure_firewall_for_zeronet {
159 156
 }
160 157
 
161 158
 function install_zeronet_blog {
162
-    if grep -Fxq "install_zeronet_blog" $COMPLETION_FILE; then
159
+    if [[ $(app_is_installed zeronet_blog) == "1" ]]; then
163 160
         return
164 161
     fi
165 162
 
@@ -256,10 +253,11 @@ function install_zeronet_blog {
256 253
         echo "ZeroNet Blog private key: $ZERONET_BLOG_PRIVATE_KEY" >> /home/$MY_USERNAME/README
257 254
     fi
258 255
 
259
-    echo 'install_zeronet_blog' >> $COMPLETION_FILE
256
+    install_completed zeronet_blog
260 257
 }
261 258
 
262 259
 function install_zeronet_mail {
260
+    if [[ $(app_is_installed zeronet_mail) == "1" ]]; then
263 261
     if grep -Fxq "install_zeronet_mail" $COMPLETION_FILE; then
264 262
         return
265 263
     fi
@@ -357,11 +355,11 @@ function install_zeronet_mail {
357 355
         echo $"ZeroNet Mail private key: $ZERONET_MAIL_PRIVATE_KEY" >> /home/$MY_USERNAME/README
358 356
     fi
359 357
 
360
-    echo 'install_zeronet_mail' >> $COMPLETION_FILE
358
+    install_completed zeronet_mail
361 359
 }
362 360
 
363 361
 function install_zeronet_forum {
364
-    if grep -Fxq "install_zeronet_forum" $COMPLETION_FILE; then
362
+    if [[ $(app_is_installed zeronet_forum) == "1" ]]; then
365 363
         return
366 364
     fi
367 365
 
@@ -452,11 +450,11 @@ function install_zeronet_forum {
452 450
         echo $"ZeroNet Forum private key: $ZERONET_FORUM_PRIVATE_KEY" >> /home/$MY_USERNAME/README
453 451
     fi
454 452
 
455
-    echo 'install_zeronet_forum' >> $COMPLETION_FILE
453
+    install_completed zeronet_forum
456 454
 }
457 455
 
458 456
 function install_zeronet_main {
459
-    if grep -Fxq "install_zeronet_main" $COMPLETION_FILE; then
457
+    if [[ $(app_is_installed zeronet_main) == "1" ]]; then
460 458
         return
461 459
     fi
462 460
 
@@ -467,7 +465,7 @@ function install_zeronet_main {
467 465
 
468 466
     function_check configure_firewall_for_zeronet
469 467
     configure_firewall_for_zeronet
470
-    echo 'install_zeronet_main' >> $COMPLETION_FILE
468
+    install_completed zeronet_main
471 469
 }
472 470
 
473 471
 function mesh_zeronet {