瀏覽代碼

Flag to indicate whether apps have installed

Bob Mottram 8 年之前
父節點
當前提交
6190639144

+ 2
- 0
src/freedombone-app-babel 查看文件

@@ -37,6 +37,7 @@ babel_variables=()
37 37
 
38 38
 function install_interactive_babel {
39 39
     echo -n ''
40
+    APP_INSTALLED=1
40 41
 }
41 42
 
42 43
 function change_password_babel {
@@ -114,6 +115,7 @@ function install_babel {
114 115
 
115 116
     function_check configure_firewall_for_babel
116 117
     configure_firewall_for_babel
118
+    APP_INSTALLED=1
117 119
 }
118 120
 
119 121
 # NOTE: deliberately there is no "exit 0"

+ 2
- 0
src/freedombone-app-batman 查看文件

@@ -38,6 +38,7 @@ batman_variables=(MY_USERNAME
38 38
 
39 39
 function install_interactive_batman {
40 40
     echo -n ''
41
+    APP_INSTALLED=1
41 42
 }
42 43
 
43 44
 function change_password_batman {
@@ -162,6 +163,7 @@ function install_batman {
162 163
 
163 164
     function_check configure_firewall_for_batman
164 165
     configure_firewall_for_batman
166
+    APP_INSTALLED=1
165 167
 }
166 168
 
167 169
 # NOTE: deliberately no exit 0

+ 4
- 2
src/freedombone-app-blog 查看文件

@@ -165,10 +165,11 @@ function install_interactive_blog {
165 165
             fi
166 166
         done
167 167
 
168
-        write_config_param "MY_BLOG_TITLE" "$MY_BLOG_TITLE"
169
-        write_config_param "FULLBLOG_DOMAIN_NAME" "$FULLBLOG_DOMAIN_NAME"
170 168
         write_config_param "FULLBLOG_CODE" "$FULLBLOG_CODE"
171 169
     fi
170
+    write_config_param "MY_BLOG_TITLE" "$MY_BLOG_TITLE"
171
+    write_config_param "FULLBLOG_DOMAIN_NAME" "$FULLBLOG_DOMAIN_NAME"
172
+    APP_INSTALLED=1
172 173
 }
173 174
 
174 175
 function change_password_blog {
@@ -675,6 +676,7 @@ function install_blog {
675 676
     if ! grep -q "blog domain:" $COMPLETION_FILE; then
676 677
         echo "blog domain:$FULLBLOG_DOMAIN_NAME" >> $COMPLETION_FILE
677 678
     fi
679
+    APP_INSTALLED=1
678 680
 }
679 681
 
680 682
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-blogstatic 查看文件

@@ -44,6 +44,7 @@ function configure_interactive_blogstatic {
44 44
 
45 45
 function install_interactive_blogstatic {
46 46
     echo -n ''
47
+    APP_INSTALLED=1
47 48
 }
48 49
 
49 50
 function change_password_blogstatic {
@@ -341,6 +342,7 @@ function install_blogstatic {
341 342
 
342 343
     chown -R $MY_USERNAME:$MY_USERNAME $STATIC_BLOG_INSTALL_DIR
343 344
     chown -R www-data:www-data $STATIC_BLOG_PATH
345
+    APP_INSTALLED=1
344 346
 }
345 347
 
346 348
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-cjdns 查看文件

@@ -53,6 +53,7 @@ cjdns_variables=(MY_USERNAME
53 53
 
54 54
 function install_interactive_cjdns {
55 55
     echo -n ''
56
+    APP_INSTALLED=1
56 57
 }
57 58
 
58 59
 function change_password_cjdns {
@@ -546,6 +547,7 @@ function install_cjdns {
546 547
     install_cjdns_main
547 548
     install_cjdns_tools
548 549
     install_completed cjdns
550
+    APP_INSTALLED=1
549 551
 }
550 552
 
551 553
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-dlna 查看文件

@@ -62,6 +62,7 @@ function configure_interactive_dlna {
62 62
 
63 63
 function install_interactive_dlna {
64 64
     echo -n ''
65
+    APP_INSTALLED=1
65 66
 }
66 67
 
67 68
 function change_password_dlna {
@@ -264,6 +265,7 @@ function script_for_attaching_usb_drive {
264 265
 function install_dlna {
265 266
     install_dlna_main
266 267
     script_for_attaching_usb_drive
268
+    APP_INSTALLED=1
267 269
 }
268 270
 
269 271
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-emacs 查看文件

@@ -35,6 +35,7 @@ emacs_variables=(USB_MOUNT
35 35
 
36 36
 function install_interactive_emacs {
37 37
     echo -n ''
38
+    APP_INSTALLED=1
38 39
 }
39 40
 
40 41
 function change_password_emacs {
@@ -185,6 +186,7 @@ function install_emacs {
185 186
     echo '(epa-file-enable)' >> /home/$MY_USERNAME/.emacs
186 187
     cp /home/$MY_USERNAME/.emacs /root/.emacs
187 188
     chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.emacs
189
+    APP_INSTALLED=1
188 190
 }
189 191
 
190 192
 # NOTE: deliberately no exit 0

+ 3
- 1
src/freedombone-app-gnusocial 查看文件

@@ -165,11 +165,12 @@ function install_interactive_gnusocial {
165 165
             fi
166 166
         done
167 167
         # save the results in the config file
168
-        write_config_param "MICROBLOG_DOMAIN_NAME" "$MICROBLOG_DOMAIN_NAME"
169 168
         write_config_param "MICROBLOG_CODE" "$MICROBLOG_CODE"
170 169
         write_config_param "MICROBLOG_WELCOME_MESSAGE" "$MICROBLOG_WELCOME_MESSAGE"
171 170
         write_config_param "MICROBLOG_BACKGROUND_IMAGE_URL" "$MICROBLOG_BACKGROUND_IMAGE_URL"
172 171
     fi
172
+    write_config_param "MICROBLOG_DOMAIN_NAME" "$MICROBLOG_DOMAIN_NAME"
173
+    APP_INSTALLED=1
173 174
 }
174 175
 
175 176
 function change_password_gnusocial {
@@ -1032,6 +1033,7 @@ function install_gnusocial {
1032 1033
     install_gnusocial_plugin_sharings
1033 1034
     install_gnusocial_plugin_sharings_theme
1034 1035
     install_gnusocial_plugin_nsfw
1036
+    APP_INSTALLED=1
1035 1037
 }
1036 1038
 
1037 1039
 # NOTE: deliberately there is no "exit 0"

+ 3
- 1
src/freedombone-app-gogs 查看文件

@@ -104,9 +104,10 @@ function install_interactive_gogs {
104 104
         done
105 105
 
106 106
         # save the results in the config file
107
-        write_config_param "GIT_DOMAIN_NAME" "$GIT_DOMAIN_NAME"
108 107
         write_config_param "GIT_CODE" "$GIT_CODE"
109 108
     fi
109
+    write_config_param "GIT_DOMAIN_NAME" "$GIT_DOMAIN_NAME"
110
+    APP_INSTALLED=1
110 111
 }
111 112
 
112 113
 function change_password_gogs {
@@ -728,6 +729,7 @@ function install_gogs {
728 729
     else
729 730
         sed -i "s|gogs version.*|gogs version:${GOGS_VERSION}|g" ${COMPLETION_FILE}
730 731
     fi
732
+    APP_INSTALLED=1
731 733
 }
732 734
 
733 735
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-hubzilla 查看文件

@@ -188,6 +188,7 @@ function install_interactive_hubzilla {
188 188
     # save the results in the config file
189 189
     write_config_param "HUBZILLA_DOMAIN_NAME" "$HUBZILLA_DOMAIN_NAME"
190 190
     write_config_param "HUBZILLA_CODE" "$HUBZILLA_CODE"
191
+    APP_INSTALLED=1
191 192
 }
192 193
 
193 194
 function change_password_hubzilla {
@@ -647,6 +648,7 @@ function install_hubzilla {
647 648
     ${PROJECT_NAME}-addemail -u $MY_USERNAME -e "noreply@$HUBZILLA_DOMAIN_NAME" -g hubzilla --public no
648 649
 
649 650
     echo "hubzilla domain:${HUBZILLA_DOMAIN_NAME}" >> $COMPLETION_FILE
651
+    APP_INSTALLED=1
650 652
 }
651 653
 
652 654
 # NOTE: deliberately there is no "exit 0"

+ 2
- 0
src/freedombone-app-ipfs 查看文件

@@ -48,6 +48,7 @@ ipfs_variables=(IPFS_COMMIT
48 48
 
49 49
 function install_interactive_ipfs {
50 50
     echo -n ''
51
+    APP_INSTALLED=1
51 52
 }
52 53
 
53 54
 function change_password_ipfs {
@@ -601,4 +602,5 @@ function install_ipfs_go {
601 602
 function install_ipfs {
602 603
     #install_ipfs_js
603 604
     install_ipfs_go
605
+    APP_INSTALLED=1
604 606
 }

+ 2
- 0
src/freedombone-app-irc 查看文件

@@ -202,6 +202,7 @@ function configure_interactive_irc {
202 202
 
203 203
 function install_interactive_irc {
204 204
     echo -n ''
205
+    APP_INSTALLED=1
205 206
 }
206 207
 
207 208
 function change_password_irc {
@@ -458,6 +459,7 @@ function install_irc_client {
458 459
 function install_irc {
459 460
     install_irc_server
460 461
     install_irc_client
462
+    APP_INSTALLED=1
461 463
 }
462 464
 
463 465
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-librevault 查看文件

@@ -45,6 +45,7 @@ librevault_variables=(PROTOBUF_REPO
45 45
 
46 46
 function install_interactive_librevault {
47 47
     echo -n ''
48
+    APP_INSTALLED=1
48 49
 }
49 50
 
50 51
 function change_password_librevault {
@@ -324,6 +325,7 @@ function install_librevault {
324 325
 
325 326
     systemctl enable librevault-daemon
326 327
     systemctl start librevault-daemon
328
+    APP_INSTALLED=1
327 329
 }
328 330
 
329 331
 # NOTE: deliberately no exit 0

+ 3
- 1
src/freedombone-app-mediagoblin 查看文件

@@ -99,9 +99,10 @@ function install_interactive_mediagoblin {
99 99
         done
100 100
 
101 101
         # save the results in the config file
102
-        write_config_param "MEDIAGOBLIN_DOMAIN_NAME" "$MEDIAGOBLIN_DOMAIN_NAME"
103 102
         write_config_param "MEDIAGOBLIN_CODE" "$MEDIAGOBLIN_CODE"
104 103
     fi
104
+    write_config_param "MEDIAGOBLIN_DOMAIN_NAME" "$MEDIAGOBLIN_DOMAIN_NAME"
105
+    APP_INSTALLED=1
105 106
 }
106 107
 
107 108
 function change_password_mediagoblin {
@@ -501,6 +502,7 @@ function install_mediagoblin {
501 502
     else
502 503
         sed -i "s/Mediagoblin domain.*/Mediagoblin domain:$MEDIAGOBLIN_DOMAIN_NAME/g" $COMPLETION_FILE
503 504
     fi
505
+    APP_INSTALLED=1
504 506
 }
505 507
 
506 508
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-mumble 查看文件

@@ -47,6 +47,7 @@ mumble_variables=(MY_USERNAME
47 47
 
48 48
 function install_interactive_mumble {
49 49
     echo -n ''
50
+    APP_INSTALLED=1
50 51
 }
51 52
 
52 53
 function change_password_mumble {
@@ -281,6 +282,7 @@ function install_mumble {
281 282
 
282 283
     function_check configure_firewall_for_mumble
283 284
     configure_firewall_for_mumble
285
+    APP_INSTALLED=1
284 286
 }
285 287
 
286 288
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-rss 查看文件

@@ -53,6 +53,7 @@ rss_variables=(RSS_READER_REPO
53 53
 
54 54
 function install_interactive_rss {
55 55
     echo -n ''
56
+    APP_INSTALLED=1
56 57
 }
57 58
 
58 59
 function change_password_rss {
@@ -605,6 +606,7 @@ function install_rss {
605 606
     install_rss_main
606 607
     install_rss_gnusocial
607 608
     install_rss_mobile_reader
609
+    APP_INSTALLED=1
608 610
 }
609 611
 
610 612
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-searx 查看文件

@@ -47,6 +47,7 @@ searx_variables=(SEARX_REPO
47 47
 
48 48
 function install_interactive_searx {
49 49
     echo -n ''
50
+    APP_INSTALLED=1
50 51
 }
51 52
 
52 53
 function change_password_searx {
@@ -288,6 +289,7 @@ function install_searx {
288 289
         chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
289 290
         chmod 600 /home/$MY_USERNAME/README
290 291
     fi
292
+    APP_INSTALLED=1
291 293
 }
292 294
 
293 295
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-sip 查看文件

@@ -86,6 +86,7 @@ function add_user_sip {
86 86
 
87 87
 function install_interactive_sip {
88 88
     echo -n ''
89
+    APP_INSTALLED=1
89 90
 }
90 91
 
91 92
 function change_password_sip {
@@ -498,6 +499,7 @@ function install_sip_turn {
498 499
 function install_sip {
499 500
     install_sip_main
500 501
     update_sipwitch_daemon
502
+    APP_INSTALLED=1
501 503
 }
502 504
 
503 505
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-syncthing 查看文件

@@ -222,6 +222,7 @@ function run_client_syncthing {
222 222
 
223 223
 function install_interactive_syncthing {
224 224
     echo -n ''
225
+    APP_INSTALLED=1
225 226
 }
226 227
 
227 228
 function change_password_syncthing {
@@ -560,6 +561,7 @@ function install_syncthing {
560 561
 
561 562
     function_check configure_firewall_for_syncthing
562 563
     configure_firewall_for_syncthing
564
+    APP_INSTALLED=1
563 565
 }
564 566
 
565 567
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-tahoelafs 查看文件

@@ -45,6 +45,7 @@ tahoelafs_variables=(TAHOELAFS_REPO
45 45
 
46 46
 function install_interactive_tahoelafs {
47 47
     echo -n ''
48
+    APP_INSTALLED=1
48 49
 }
49 50
 
50 51
 function change_password_tahoelafs {
@@ -357,6 +358,7 @@ function install_tahoelafs {
357 358
     systemctl enable tahoelafs
358 359
     systemctl daemon-reload
359 360
     systemctl start tahoelafs
361
+    APP_INSTALLED=1
360 362
 }
361 363
 
362 364
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-tox 查看文件

@@ -100,6 +100,7 @@ function run_client_tox {
100 100
 
101 101
 function install_interactive_tox {
102 102
     echo -n ''
103
+    APP_INSTALLED=1
103 104
 }
104 105
 
105 106
 function change_password_tox {
@@ -706,6 +707,7 @@ function install_tox {
706 707
         tox_avahi
707 708
         install_tox_client
708 709
     fi
710
+    APP_INSTALLED=1
709 711
 }
710 712
 
711 713
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-vpn 查看文件

@@ -34,6 +34,7 @@ vpn_variables=()
34 34
 
35 35
 function install_interactive_vpn {
36 36
     echo -n ''
37
+    APP_INSTALLED=1
37 38
 }
38 39
 
39 40
 function change_password_vpn {
@@ -83,6 +84,7 @@ function install_vpn {
83 84
             exit 52026
84 85
         fi
85 86
     fi
87
+    APP_INSTALLED=1
86 88
 }
87 89
 
88 90
 # NOTE: deliberately there is no "exit 0"

+ 2
- 0
src/freedombone-app-webmail 查看文件

@@ -46,6 +46,7 @@ webmail_variables=(WEBMAIL_REPO
46 46
 
47 47
 function install_interactive_webmail {
48 48
     echo -n ''
49
+    APP_INSTALLED=1
49 50
 }
50 51
 
51 52
 function change_password_webmail {
@@ -259,6 +260,7 @@ function install_webmail {
259 260
         chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
260 261
         chmod 600 /home/$MY_USERNAME/README
261 262
     fi
263
+    APP_INSTALLED=1
262 264
 }
263 265
 
264 266
 # NOTE: deliberately no exit 0

+ 4
- 2
src/freedombone-app-wiki 查看文件

@@ -99,10 +99,11 @@ function install_interactive_wiki {
99 99
         done
100 100
 
101 101
         # save the results in the config file
102
-        write_config_param "WIKI_TITLE" "$WIKI_TITLE"
103
-        write_config_param "WIKI_DOMAIN_NAME" "$WIKI_DOMAIN_NAME"
104 102
         write_config_param "WIKI_CODE" "$WIKI_CODE"
105 103
     fi
104
+    write_config_param "WIKI_TITLE" "$WIKI_TITLE"
105
+    write_config_param "WIKI_DOMAIN_NAME" "$WIKI_DOMAIN_NAME"
106
+    APP_INSTALLED=1
106 107
 }
107 108
 
108 109
 function change_password_wiki {
@@ -614,6 +615,7 @@ function install_wiki {
614 615
     else
615 616
         sed -i "s|wiki domain.*|wiki domain:$WIKI_DOMAIN_NAME|g" $COMPLETION_FILE
616 617
     fi
618
+    APP_INSTALLED=1
617 619
 }
618 620
 
619 621
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-xmpp 查看文件

@@ -96,6 +96,7 @@ function run_client_xmpp {
96 96
 
97 97
 function install_interactive_xmpp {
98 98
     echo -n ''
99
+    APP_INSTALLED=1
99 100
 }
100 101
 
101 102
 function change_password_xmpp {
@@ -554,6 +555,7 @@ function install_xmpp_client {
554 555
 function install_xmpp {
555 556
     install_xmpp_main
556 557
     install_xmpp_client
558
+    APP_INSTALLED=1
557 559
 }
558 560
 
559 561
 # NOTE: deliberately no exit 0

+ 2
- 0
src/freedombone-app-zeronet 查看文件

@@ -61,6 +61,7 @@ zeronet_variables=(ZERONET_BLOG_COMMIT
61 61
 
62 62
 function install_interactive_zeronet {
63 63
     echo -n ''
64
+    APP_INSTALLED=1
64 65
 }
65 66
 
66 67
 function change_password_zeronet {
@@ -686,6 +687,7 @@ function install_zeronet {
686 687
     install_zeronet_blog
687 688
     install_zeronet_mail
688 689
     install_zeronet_forum
690
+    APP_INSTALLED=1
689 691
 }
690 692
 
691 693
 # NOTE: deliberately no exit 0

+ 16
- 6
src/freedombone-utils-selector 查看文件

@@ -402,10 +402,15 @@ function install_apps {
402 402
                         echo $"${a} was upgraded from interactive"
403 403
                     else
404 404
                         echo $"Installing application from interactive: ${a}"
405
+                        APP_INSTALLED=
405 406
                         install_${a}
406
-                        app_save_variables ${a}
407
-                        install_completed ${a}
408
-                        echo $"${a} was installed from interactive"
407
+                        if [ $APP_INSTALLED ]; then
408
+                            app_save_variables ${a}
409
+                            install_completed ${a}
410
+                            echo $"${a} was installed from interactive"
411
+                        else
412
+                            echo $"${a} was not installed from interactive"
413
+                        fi
409 414
                     fi
410 415
                 else
411 416
                     # check if the app was removed
@@ -417,10 +422,15 @@ function install_apps {
417 422
                             echo $"${a} was upgraded"
418 423
                         else
419 424
                             echo $"Installing application: ${a}"
425
+                            APP_INSTALLED=
420 426
                             install_${a}
421
-                            app_save_variables ${a}
422
-                            install_completed ${a}
423
-                            echo $"${a} was installed"
427
+                            if [ $APP_INSTALLED ]; then
428
+                                app_save_variables ${a}
429
+                                install_completed ${a}
430
+                                echo $"${a} was installed"
431
+                            else
432
+                                echo $"${a} was not installed"
433
+                            fi
424 434
                         fi
425 435
                     else
426 436
                         echo $"${a} has been removed and so will not be reinstalled"