Bob Mottram 8 лет назад
Родитель
Сommit
68ed1a81df

+ 3
- 2
src/freedombone-app-blog Просмотреть файл

180
 }
180
 }
181
 
181
 
182
 function upgrade_blog {
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
     fi
185
     fi
186
+
186
     function_check set_repo_commit
187
     function_check set_repo_commit
187
     set_repo_commit /var/www/$FULLBLOG_DOMAIN_NAME/htdocs "Blog commit" "$FULLBLOG_COMMIT" $FULLBLOG_REPO
188
     set_repo_commit /var/www/$FULLBLOG_DOMAIN_NAME/htdocs "Blog commit" "$FULLBLOG_COMMIT" $FULLBLOG_REPO
188
 
189
 

+ 2
- 2
src/freedombone-app-gnusocial Просмотреть файл

222
 }
222
 }
223
 
223
 
224
 function upgrade_gnusocial {
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
     fi
227
     fi
228
 
228
 
229
     # update to the next commit
229
     # update to the next commit

+ 0
- 4
src/freedombone-app-gogs Просмотреть файл

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

+ 3
- 2
src/freedombone-app-hubzilla Просмотреть файл

250
 }
250
 }
251
 
251
 
252
 function upgrade_hubzilla {
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
     fi
255
     fi
256
+
256
     HUBZILLA_PATH=/var/www/$HUBZILLA_DOMAIN_NAME/htdocs
257
     HUBZILLA_PATH=/var/www/$HUBZILLA_DOMAIN_NAME/htdocs
257
 
258
 
258
     function_check set_repo_commit
259
     function_check set_repo_commit

+ 2
- 2
src/freedombone-app-ipfs Просмотреть файл

54
 }
54
 }
55
 
55
 
56
 function upgrade_ipfs_go {
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
         return
58
         return
59
     fi
59
     fi
60
 
60
 
63
 }
63
 }
64
 
64
 
65
 function upgrade_ipfs_js {
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
         return
67
         return
68
     fi
68
     fi
69
 
69
 

+ 2
- 2
src/freedombone-app-irc Просмотреть файл

186
 }
186
 }
187
 
187
 
188
 function install_irc_server {
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
         return
190
         return
191
     fi
191
     fi
192
     apt-get -y install ngircd
192
     apt-get -y install ngircd
293
 }
293
 }
294
 
294
 
295
 function install_irc_client {
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
         return
297
         return
298
     fi
298
     fi
299
     apt-get -y install irssi
299
     apt-get -y install irssi

+ 0
- 4
src/freedombone-app-librevault Просмотреть файл

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

+ 0
- 4
src/freedombone-app-searx Просмотреть файл

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

+ 4
- 4
src/freedombone-app-sip Просмотреть файл

221
 }
221
 }
222
 
222
 
223
 function install_sip_main {
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
         return
225
         return
226
     fi
226
     fi
227
 
227
 
301
 
301
 
302
     function_check configure_firewall_for_sip4
302
     function_check configure_firewall_for_sip4
303
     configure_firewall_for_sip4
303
     configure_firewall_for_sip4
304
-    echo 'install_sip_main' >> $COMPLETION_FILE
304
+    install_completed sip_main
305
 }
305
 }
306
 
306
 
307
 function install_sip_turn {
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
         return
309
         return
310
     fi
310
     fi
311
 
311
 
442
 
442
 
443
     function_check configure_firewall_for_voip_turn
443
     function_check configure_firewall_for_voip_turn
444
     configure_firewall_for_voip_turn
444
     configure_firewall_for_voip_turn
445
-    echo 'install_sip_turn' >> $COMPLETION_FILE
445
+    install_completed sip_turn
446
 }
446
 }
447
 
447
 
448
 function install_sip {
448
 function install_sip {

+ 4
- 7
src/freedombone-app-tox Просмотреть файл

105
 }
105
 }
106
 
106
 
107
 function upgrade_tox {
107
 function upgrade_tox {
108
-    if ! grep -Fxq "install_tox" $COMPLETION_FILE; then
109
-        return
110
-    fi
111
     function_check set_repo_commit
108
     function_check set_repo_commit
112
     set_repo_commit $INSTALL_DIR/toxcore "toxcore commit" "$TOXCORE_COMMIT" $TOXCORE_REPO
109
     set_repo_commit $INSTALL_DIR/toxcore "toxcore commit" "$TOXCORE_COMMIT" $TOXCORE_REPO
113
 
110
 
316
 }
313
 }
317
 
314
 
318
 function install_tox_node {
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
         return
317
         return
321
     fi
318
     fi
322
 
319
 
355
 
352
 
356
     function_check configure_firewall_for_tox
353
     function_check configure_firewall_for_tox
357
     configure_firewall_for_tox
354
     configure_firewall_for_tox
358
-    echo 'install_tox_node' >> $COMPLETION_FILE
355
+    install_completed tox_node
359
 }
356
 }
360
 
357
 
361
 function install_tox_client {
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
         return
360
         return
364
     fi
361
     fi
365
 
362
 
366
     function_check mesh_tox_client
363
     function_check mesh_tox_client
367
     mesh_tox_client
364
     mesh_tox_client
368
 
365
 
369
-    echo 'install_tox_client' >> $COMPLETION_FILE
366
+    install_completed tox_client
370
 }
367
 }
371
 
368
 
372
 function mesh_tox_node {
369
 function mesh_tox_node {

+ 0
- 3
src/freedombone-app-webmail Просмотреть файл

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

+ 4
- 7
src/freedombone-app-xmpp Просмотреть файл

117
 }
117
 }
118
 
118
 
119
 function upgrade_xmpp {
119
 function upgrade_xmpp {
120
-    if ! grep -Fxq "install_xmpp_main" $COMPLETION_FILE; then
121
-        return
122
-    fi
123
     function_check update_prosody_modules
120
     function_check update_prosody_modules
124
     update_prosody_modules
121
     update_prosody_modules
125
 }
122
 }
259
 function install_xmpp_main {
256
 function install_xmpp_main {
260
     update_prosody_modules
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
         return
260
         return
264
     fi
261
     fi
265
     apt-get -y install lua-sec lua-bitop
262
     apt-get -y install lua-sec lua-bitop
431
     configure_firewall_for_xmpp
428
     configure_firewall_for_xmpp
432
     xmpp_email_headers
429
     xmpp_email_headers
433
 
430
 
434
-    echo 'install_xmpp_main' >> $COMPLETION_FILE
431
+    install_completed xmpp_main
435
 }
432
 }
436
 
433
 
437
 function install_xmpp_client {
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
         return
436
         return
440
     fi
437
     fi
441
     apt-get -y install profanity
438
     apt-get -y install profanity
498
     chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.local
495
     chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.local
499
     chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.config
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
 function install_xmpp {
501
 function install_xmpp {

+ 8
- 10
src/freedombone-app-zeronet Просмотреть файл

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