Bob Mottram 8 years ago
parent
commit
ce4afbf5a1

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

100
 }
100
 }
101
 
101
 
102
 function install_babel {
102
 function install_babel {
103
-    if grep -Fxq "install_babel" $COMPLETION_FILE; then
103
+    if [[ $(app_is_installed babel) == "1" ]]; then
104
         return
104
         return
105
     fi
105
     fi
106
     if [[ $ENABLE_BABEL != "yes" ]]; then
106
     if [[ $ENABLE_BABEL != "yes" ]]; then
115
 
115
 
116
     function_check configure_firewall_for_babel
116
     function_check configure_firewall_for_babel
117
     configure_firewall_for_babel
117
     configure_firewall_for_babel
118
-    echo 'install_babel' >> $COMPLETION_FILE
118
+    install_completed babel
119
 }
119
 }
120
 
120
 
121
 # NOTE: deliberately there is no "exit 0"
121
 # NOTE: deliberately there is no "exit 0"

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

135
         mesh_install_batman
135
         mesh_install_batman
136
         return
136
         return
137
     fi
137
     fi
138
-    if grep -Fxq "install_batman" $COMPLETION_FILE; then
138
+    if [[ $(app_is_installed batman) == "1" ]]; then
139
         return
139
         return
140
     fi
140
     fi
141
     if [[ $ENABLE_BATMAN != "yes" ]]; then
141
     if [[ $ENABLE_BATMAN != "yes" ]]; then
162
 
162
 
163
     function_check configure_firewall_for_batman
163
     function_check configure_firewall_for_batman
164
     configure_firewall_for_batman
164
     configure_firewall_for_batman
165
-    echo 'install_batman' >> $COMPLETION_FILE
165
+    install_completed batman
166
 }
166
 }
167
 
167
 
168
 # NOTE: deliberately no exit 0
168
 # NOTE: deliberately no exit 0

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

500
         exit 5062
500
         exit 5062
501
     fi
501
     fi
502
 
502
 
503
-    if grep -Fxq "install_blog" $COMPLETION_FILE; then
503
+    if [[ $(app_is_installed blog) == "1" ]]; then
504
         return
504
         return
505
     fi
505
     fi
506
 
506
 
560
         echo "Blog domain:$FULLBLOG_DOMAIN_NAME" >> $COMPLETION_FILE
560
         echo "Blog domain:$FULLBLOG_DOMAIN_NAME" >> $COMPLETION_FILE
561
     fi
561
     fi
562
 
562
 
563
-    echo 'install_blog' >> $COMPLETION_FILE
563
+    install_completed blog
564
 }
564
 }
565
 
565
 
566
 # NOTE: deliberately no exit 0
566
 # NOTE: deliberately no exit 0

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

305
         return
305
         return
306
     fi
306
     fi
307
 
307
 
308
-    if grep -Fxq "install_blogstatic" $COMPLETION_FILE; then
308
+    if [[ $(app_is_installed blogstatic) == "1" ]]; then
309
         return
309
         return
310
     fi
310
     fi
311
 
311
 
343
     chown -R $MY_USERNAME:$MY_USERNAME $STATIC_BLOG_INSTALL_DIR
343
     chown -R $MY_USERNAME:$MY_USERNAME $STATIC_BLOG_INSTALL_DIR
344
     chown -R www-data:www-data $STATIC_BLOG_PATH
344
     chown -R www-data:www-data $STATIC_BLOG_PATH
345
 
345
 
346
-    echo 'install_blogstatic' >> $COMPLETION_FILE
346
+    install_completed blogstatic
347
 }
347
 }
348
 
348
 
349
 # NOTE: deliberately no exit 0
349
 # NOTE: deliberately no exit 0

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

533
 }
533
 }
534
 
534
 
535
 function install_cjdns {
535
 function install_cjdns {
536
-    if grep -Fxq "install_cjdns" $COMPLETION_FILE; then
536
+    if [[ $(app_is_installed cjdns) == "1" ]]; then
537
         return
537
         return
538
     fi
538
     fi
539
     install_cjdns_main
539
     install_cjdns_main
540
     install_cjdns_tools
540
     install_cjdns_tools
541
-    echo 'install_cjdns' >> $COMPLETION_FILE
541
+    install_completed cjdns
542
 }
542
 }
543
 
543
 
544
 # NOTE: deliberately no exit 0
544
 # NOTE: deliberately no exit 0

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

257
 }
257
 }
258
 
258
 
259
 function install_dlna {
259
 function install_dlna {
260
-    if grep -Fxq "install_dlna" $COMPLETION_FILE; then
260
+    if [[ $(app_is_installed dlna) == "1" ]]; then
261
         return
261
         return
262
     fi
262
     fi
263
     install_dlna_main
263
     install_dlna_main
264
     script_for_attaching_usb_drive
264
     script_for_attaching_usb_drive
265
-    echo 'install_dlna' >> $COMPLETION_FILE
265
+    install_completed dlna
266
 }
266
 }
267
 
267
 
268
 # NOTE: deliberately no exit 0
268
 # NOTE: deliberately no exit 0

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

108
 }
108
 }
109
 
109
 
110
 function install_emacs {
110
 function install_emacs {
111
-    if grep -Fxq "install_emacs" $COMPLETION_FILE; then
111
+    if [[ $(app_is_installed emacs) == "1" ]]; then
112
         return
112
         return
113
     fi
113
     fi
114
     update-alternatives --set editor /usr/bin/emacs24
114
     update-alternatives --set editor /usr/bin/emacs24
186
     cp /home/$MY_USERNAME/.emacs /root/.emacs
186
     cp /home/$MY_USERNAME/.emacs /root/.emacs
187
     chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.emacs
187
     chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.emacs
188
 
188
 
189
-    echo 'install_emacs' >> $COMPLETION_FILE
189
+    install_completed emacs
190
 }
190
 }
191
 
191
 
192
 # NOTE: deliberately no exit 0
192
 # NOTE: deliberately no exit 0

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

876
 }
876
 }
877
 
877
 
878
 function install_gnusocial {
878
 function install_gnusocial {
879
-    if grep -Fxq "install_gnusocial" $COMPLETION_FILE; then
879
+    if [[ $(app_is_installed gnusocial) == "1" ]]; then
880
         return
880
         return
881
     fi
881
     fi
882
     install_gnusocial_main
882
     install_gnusocial_main
886
     install_gnusocial_plugin_sharings
886
     install_gnusocial_plugin_sharings
887
     install_gnusocial_plugin_sharings_theme
887
     install_gnusocial_plugin_sharings_theme
888
     install_gnusocial_plugin_nsfw
888
     install_gnusocial_plugin_nsfw
889
-    echo 'install_gnusocial' >> $COMPLETION_FILE
889
+    install_completed gnusocial
890
 }
890
 }
891
 
891
 
892
 # NOTE: deliberately there is no "exit 0"
892
 # NOTE: deliberately there is no "exit 0"

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

345
         return
345
         return
346
     fi
346
     fi
347
 
347
 
348
-    if grep -Fxq "install_gogs" $COMPLETION_FILE; then
348
+    if [[ $(app_is_installed gogs) == "1" ]]; then
349
         return
349
         return
350
     fi
350
     fi
351
 
351
 
666
     else
666
     else
667
         sed -i "s|Gogs version.*|Gogs version:$GOGS_VERSION|g" $COMPLETION_FILE
667
         sed -i "s|Gogs version.*|Gogs version:$GOGS_VERSION|g" $COMPLETION_FILE
668
     fi
668
     fi
669
-    echo 'install_gogs' >> $COMPLETION_FILE
669
+    install_completed gogs
670
 }
670
 }
671
 
671
 
672
 # NOTE: deliberately no exit 0
672
 # NOTE: deliberately no exit 0

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

310
         return
310
         return
311
     fi
311
     fi
312
 
312
 
313
-    if grep -Fxq "install_hubzilla" $COMPLETION_FILE; then
313
+    if [[ $(app_is_installed hubzilla) == "1" ]]; then
314
         return
314
         return
315
     fi
315
     fi
316
 
316
 
611
     ${PROJECT_NAME}-addemail -u $MY_USERNAME -e "noreply@$HUBZILLA_DOMAIN_NAME" -g hubzilla --public no
611
     ${PROJECT_NAME}-addemail -u $MY_USERNAME -e "noreply@$HUBZILLA_DOMAIN_NAME" -g hubzilla --public no
612
 
612
 
613
     echo "Hubzilla domain:${HUBZILLA_DOMAIN_NAME}" >> $COMPLETION_FILE
613
     echo "Hubzilla domain:${HUBZILLA_DOMAIN_NAME}" >> $COMPLETION_FILE
614
-    echo 'install_hubzilla' >> $COMPLETION_FILE
614
+    install_completed hubzilla
615
 }
615
 }
616
 
616
 
617
 # NOTE: deliberately there is no "exit 0"
617
 # NOTE: deliberately there is no "exit 0"

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

288
         mesh_install_ipfs_js
288
         mesh_install_ipfs_js
289
         return
289
         return
290
     fi
290
     fi
291
-    if grep -Fxq "install_ipfs_js" $COMPLETION_FILE; then
291
+    if [[ $(app_is_installed ipfs_js) == "1" ]]; then
292
         return
292
         return
293
     fi
293
     fi
294
 
294
 
378
     function_check configure_firewall_for_ipfs
378
     function_check configure_firewall_for_ipfs
379
     configure_firewall_for_ipfs
379
     configure_firewall_for_ipfs
380
 
380
 
381
-    echo 'install_ipfs_js' >> $COMPLETION_FILE
381
+    install_completed ipfs_js
382
 }
382
 }
383
 
383
 
384
 function mesh_install_ipfs_go {
384
 function mesh_install_ipfs_go {
455
         mesh_install_ipfs_go
455
         mesh_install_ipfs_go
456
         return
456
         return
457
     fi
457
     fi
458
-    if grep -Fxq "install_ipfs_go" $COMPLETION_FILE; then
458
+    if [[ $(app_is_installed ipfs_go) == "1" ]]; then
459
         return
459
         return
460
     fi
460
     fi
461
 
461
 
590
     function_check configure_firewall_for_ipfs
590
     function_check configure_firewall_for_ipfs
591
     configure_firewall_for_ipfs
591
     configure_firewall_for_ipfs
592
 
592
 
593
-    echo 'install_ipfs_go' >> $COMPLETION_FILE
593
+    install_completed ipfs_go
594
 }
594
 }
595
 
595
 
596
 function install_ipfs {
596
 function install_ipfs {

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

381
 }
381
 }
382
 
382
 
383
 function install_irc {
383
 function install_irc {
384
-    if grep -Fxq "install_irc" $COMPLETION_FILE; then
384
+    if [[ $(app_is_installed irc) == "1" ]]; then
385
         return
385
         return
386
     fi
386
     fi
387
     install_irc_server
387
     install_irc_server
388
     install_irc_client
388
     install_irc_client
389
-    echo 'install_irc' >> $COMPLETION_FILE
389
+    install_completed irc
390
 }
390
 }
391
 
391
 
392
 # NOTE: deliberately no exit 0
392
 # NOTE: deliberately no exit 0

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

231
         return
231
         return
232
     fi
232
     fi
233
 
233
 
234
-    if grep -Fxq "install_librevalut" $COMPLETION_FILE; then
234
+    if [[ $(app_is_installed librevault) == "1" ]]; then
235
         return
235
         return
236
     fi
236
     fi
237
 
237
 
327
     systemctl enable librevault-daemon
327
     systemctl enable librevault-daemon
328
     systemctl start librevault-daemon
328
     systemctl start librevault-daemon
329
 
329
 
330
-    echo 'install_librevault' >> $COMPLETION_FILE
330
+    install_completed librevault
331
 }
331
 }
332
 
332
 
333
 # NOTE: deliberately no exit 0
333
 # NOTE: deliberately no exit 0

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

115
         chown -hR mediagoblin:www-data $MEDIAGOBLIN_WORKING_DIRECTORY
115
         chown -hR mediagoblin:www-data $MEDIAGOBLIN_WORKING_DIRECTORY
116
     fi
116
     fi
117
 
117
 
118
-    if grep -Fxq "install_mediagoblin" $COMPLETION_FILE; then
118
+    if [[ $(app_is_installed mediagoblin) == "1" ]]; then
119
         return
119
         return
120
     fi
120
     fi
121
 
121
 
427
         sed -i "s/Mediagoblin domain.*/Mediagoblin domain:$MEDIAGOBLIN_DOMAIN_NAME/g" $COMPLETION_FILE
427
         sed -i "s/Mediagoblin domain.*/Mediagoblin domain:$MEDIAGOBLIN_DOMAIN_NAME/g" $COMPLETION_FILE
428
     fi
428
     fi
429
 
429
 
430
-    echo 'install_mediagoblin' >> $COMPLETION_FILE
430
+    install_completed mediagoblin
431
 }
431
 }
432
 
432
 
433
 # NOTE: deliberately no exit 0
433
 # NOTE: deliberately no exit 0

+ 2
- 5
src/freedombone-app-mumble View File

201
 }
201
 }
202
 
202
 
203
 function install_mumble {
203
 function install_mumble {
204
-    if grep -Fxq "install_mumble" $COMPLETION_FILE; then
205
-        return
206
-    fi
207
-    if grep -Fxq "install_voip" $COMPLETION_FILE; then
204
+    if [[ $(app_is_installed mumble) == "1" ]]; then
208
         return
205
         return
209
     fi
206
     fi
210
     apt-get -y install mumble-server
207
     apt-get -y install mumble-server
297
 
294
 
298
     function_check configure_firewall_for_voip
295
     function_check configure_firewall_for_voip
299
     configure_firewall_for_voip
296
     configure_firewall_for_voip
300
-    echo 'install_mumble' >> $COMPLETION_FILE
297
+    install_completed mumble
301
 }
298
 }
302
 
299
 
303
 # NOTE: deliberately no exit 0
300
 # NOTE: deliberately no exit 0

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

621
 }
621
 }
622
 
622
 
623
 function install_rss {
623
 function install_rss {
624
-    if grep -Fxq "install_rss" $COMPLETION_FILE; then
624
+    if [[ $(app_is_installed rss) == "1" ]]; then
625
         return
625
         return
626
     fi
626
     fi
627
     install_rss_main
627
     install_rss_main
628
     install_rss_gnusocial
628
     install_rss_gnusocial
629
     install_rss_mobile_reader
629
     install_rss_mobile_reader
630
-    echo 'install_rss' >> $COMPLETION_FILE
630
+    install_completed rss
631
 }
631
 }
632
 
632
 
633
 # NOTE: deliberately no exit 0
633
 # NOTE: deliberately no exit 0

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

122
         exit 62429
122
         exit 62429
123
     fi
123
     fi
124
 
124
 
125
-    if grep -Fxq "install_searx" $COMPLETION_FILE; then
125
+    if [[ $(app_is_installed searx) == "1" ]]; then
126
         return
126
         return
127
     fi
127
     fi
128
 
128
 
298
         chmod 600 /home/$MY_USERNAME/README
298
         chmod 600 /home/$MY_USERNAME/README
299
     fi
299
     fi
300
 
300
 
301
-    echo 'install_searx' >> $COMPLETION_FILE
301
+    install_completed searx
302
 }
302
 }
303
 
303
 
304
 # NOTE: deliberately no exit 0
304
 # NOTE: deliberately no exit 0

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

449
 }
449
 }
450
 
450
 
451
 function install_sip {
451
 function install_sip {
452
-    if grep -Fxq "install_sip" $COMPLETION_FILE; then
452
+    if [[ $(app_is_installed sip) == "1" ]]; then
453
         return
453
         return
454
     fi
454
     fi
455
     install_sip_main
455
     install_sip_main
456
     update_sipwitch_daemon
456
     update_sipwitch_daemon
457
-    echo 'install_sip' >> $COMPLETION_FILE
457
+    install_completed sip
458
 }
458
 }
459
 
459
 
460
 # NOTE: deliberately no exit 0
460
 # NOTE: deliberately no exit 0

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

470
         return
470
         return
471
     fi
471
     fi
472
 
472
 
473
-    if grep -Fxq "install_syncthing" $COMPLETION_FILE; then
473
+    if [[ $(app_is_installed syncthing) == "1" ]]; then
474
         return
474
         return
475
     fi
475
     fi
476
 
476
 
508
 
508
 
509
     function_check configure_firewall_for_syncthing
509
     function_check configure_firewall_for_syncthing
510
     configure_firewall_for_syncthing
510
     configure_firewall_for_syncthing
511
-    echo 'install_syncthing' >> $COMPLETION_FILE
511
+    install_completed syncthing
512
 }
512
 }
513
 
513
 
514
 # NOTE: deliberately no exit 0
514
 # NOTE: deliberately no exit 0

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

292
         return
292
         return
293
     fi
293
     fi
294
 
294
 
295
-    if grep -Fxq "install_tahoelafs" $COMPLETION_FILE; then
295
+    if [[ $(app_is_installed tahoelafs) == "1" ]]; then
296
         return
296
         return
297
     fi
297
     fi
298
 
298
 
358
     systemctl daemon-reload
358
     systemctl daemon-reload
359
     systemctl start tahoelafs
359
     systemctl start tahoelafs
360
 
360
 
361
-    echo 'install_tahoelafs' >> $COMPLETION_FILE
361
+    install_completed tahoelafs
362
 }
362
 }
363
 
363
 
364
 # NOTE: deliberately no exit 0
364
 # NOTE: deliberately no exit 0

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

666
 
666
 
667
 function install_tox {
667
 function install_tox {
668
     if [ ! $INSTALLING_MESH ]; then
668
     if [ ! $INSTALLING_MESH ]; then
669
-        if grep -Fxq "install_tox" $COMPLETION_FILE; then
669
+        if [[ $(app_is_installed tox) == "1" ]]; then
670
             return
670
             return
671
         fi
671
         fi
672
     fi
672
     fi
683
         install_tox_client
683
         install_tox_client
684
     fi
684
     fi
685
 
685
 
686
-    echo 'install_tox' >> $COMPLETION_FILE
686
+    install_completed tox
687
 }
687
 }
688
 
688
 
689
 # NOTE: deliberately no exit 0
689
 # NOTE: deliberately no exit 0

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

68
 }
68
 }
69
 
69
 
70
 function install_vpn {
70
 function install_vpn {
71
-    if grep -Fxq "install_vpn" $COMPLETION_FILE; then
71
+    if [[ $(app_is_installed vpn) == "1" ]]; then
72
         return
72
         return
73
     fi
73
     fi
74
     if ! grep -q "repo.universe-factory.net" /etc/apt/sources.list; then
74
     if ! grep -q "repo.universe-factory.net" /etc/apt/sources.list; then
84
             exit 52026
84
             exit 52026
85
         fi
85
         fi
86
     fi
86
     fi
87
-    echo 'install_vpn' >> $COMPLETION_FILE
87
+    install_completed vpn
88
 }
88
 }
89
 
89
 
90
 # NOTE: deliberately there is no "exit 0"
90
 # NOTE: deliberately there is no "exit 0"

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

138
 }
138
 }
139
 
139
 
140
 function install_webmail {
140
 function install_webmail {
141
-    if grep -Fxq "install_webmail" $COMPLETION_FILE; then
141
+    if [[ $(app_is_installed webmail) == "1" ]]; then
142
         return
142
         return
143
     fi
143
     fi
144
     if [ -d /etc/apache2 ]; then
144
     if [ -d /etc/apache2 ]; then
261
         chmod 600 /home/$MY_USERNAME/README
261
         chmod 600 /home/$MY_USERNAME/README
262
     fi
262
     fi
263
 
263
 
264
-    echo 'install_webmail' >> $COMPLETION_FILE
264
+    install_completed webmail
265
 }
265
 }
266
 
266
 
267
 # NOTE: deliberately no exit 0
267
 # NOTE: deliberately no exit 0

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

178
 }
178
 }
179
 
179
 
180
 function install_wiki {
180
 function install_wiki {
181
-    if grep -Fxq "install_wiki" $COMPLETION_FILE; then
181
+    if [[ $(app_is_installed wiki) == "1" ]]; then
182
         return
182
         return
183
     fi
183
     fi
184
     if [ ! $WIKI_DOMAIN_NAME ]; then
184
     if [ ! $WIKI_DOMAIN_NAME ]; then
539
     fi
539
     fi
540
 
540
 
541
     echo "Wiki domain:$WIKI_DOMAIN_NAME" >> $COMPLETION_FILE
541
     echo "Wiki domain:$WIKI_DOMAIN_NAME" >> $COMPLETION_FILE
542
-    echo 'install_wiki' >> $COMPLETION_FILE
542
+    install_completed wiki
543
 }
543
 }
544
 
544
 
545
 # NOTE: deliberately no exit 0
545
 # NOTE: deliberately no exit 0

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

502
 }
502
 }
503
 
503
 
504
 function install_xmpp {
504
 function install_xmpp {
505
-    if grep -Fxq "install_xmpp" $COMPLETION_FILE; then
505
+    if [[ $(app_is_installed xmpp) == "1" ]]; then
506
         return
506
         return
507
     fi
507
     fi
508
     install_xmpp_main
508
     install_xmpp_main
509
     install_xmpp_client
509
     install_xmpp_client
510
-    echo 'install_xmpp' >> $COMPLETION_FILE
510
+    install_completed xmpp
511
 }
511
 }
512
 
512
 
513
 # NOTE: deliberately no exit 0
513
 # NOTE: deliberately no exit 0

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

675
         mesh_zeronet_forum
675
         mesh_zeronet_forum
676
         return
676
         return
677
     fi
677
     fi
678
-    if grep -Fxq "install_zeronet" $COMPLETION_FILE; then
678
+    if [[ $(app_is_installed zeronet) == "1" ]]; then
679
         return
679
         return
680
     fi
680
     fi
681
     install_zeronet_main
681
     install_zeronet_main
682
     install_zeronet_blog
682
     install_zeronet_blog
683
     install_zeronet_mail
683
     install_zeronet_mail
684
     install_zeronet_forum
684
     install_zeronet_forum
685
-    echo 'install_zeronet' >> $COMPLETION_FILE
685
+    install_completed zeronet
686
 }
686
 }
687
 
687
 
688
 # NOTE: deliberately no exit 0
688
 # NOTE: deliberately no exit 0

+ 7
- 0
src/freedombone-utils-selector View File

71
     fi
71
     fi
72
 }
72
 }
73
 
73
 
74
+function install_completed {
75
+    if [ ! ${1} ]; then
76
+        exit 673935
77
+    fi
78
+    echo "install_${1}" >> $COMPLETION_FILE
79
+}
80
+
74
 function get_apps_installed {
81
 function get_apps_installed {
75
     for a in "${APPS_AVAILABLE[@]}"
82
     for a in "${APPS_AVAILABLE[@]}"
76
     do
83
     do