From 6190639144475070cdaf6db8d2b18554793373c5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 10 Oct 2016 19:11:33 +0100 Subject: [PATCH] Flag to indicate whether apps have installed --- src/freedombone-app-babel | 2 ++ src/freedombone-app-batman | 2 ++ src/freedombone-app-blog | 6 ++++-- src/freedombone-app-blogstatic | 2 ++ src/freedombone-app-cjdns | 2 ++ src/freedombone-app-dlna | 2 ++ src/freedombone-app-emacs | 2 ++ src/freedombone-app-gnusocial | 4 +++- src/freedombone-app-gogs | 4 +++- src/freedombone-app-hubzilla | 2 ++ src/freedombone-app-ipfs | 2 ++ src/freedombone-app-irc | 2 ++ src/freedombone-app-librevault | 2 ++ src/freedombone-app-mediagoblin | 4 +++- src/freedombone-app-mumble | 2 ++ src/freedombone-app-rss | 2 ++ src/freedombone-app-searx | 2 ++ src/freedombone-app-sip | 2 ++ src/freedombone-app-syncthing | 2 ++ src/freedombone-app-tahoelafs | 2 ++ src/freedombone-app-tox | 2 ++ src/freedombone-app-vpn | 2 ++ src/freedombone-app-webmail | 2 ++ src/freedombone-app-wiki | 6 ++++-- src/freedombone-app-xmpp | 2 ++ src/freedombone-app-zeronet | 2 ++ src/freedombone-utils-selector | 22 ++++++++++++++++------ 27 files changed, 75 insertions(+), 13 deletions(-) diff --git a/src/freedombone-app-babel b/src/freedombone-app-babel index f4e3cb2b..33aa6040 100755 --- a/src/freedombone-app-babel +++ b/src/freedombone-app-babel @@ -37,6 +37,7 @@ babel_variables=() function install_interactive_babel { echo -n '' + APP_INSTALLED=1 } function change_password_babel { @@ -114,6 +115,7 @@ function install_babel { function_check configure_firewall_for_babel configure_firewall_for_babel + APP_INSTALLED=1 } # NOTE: deliberately there is no "exit 0" diff --git a/src/freedombone-app-batman b/src/freedombone-app-batman index 6290da10..5fda61d3 100755 --- a/src/freedombone-app-batman +++ b/src/freedombone-app-batman @@ -38,6 +38,7 @@ batman_variables=(MY_USERNAME function install_interactive_batman { echo -n '' + APP_INSTALLED=1 } function change_password_batman { @@ -162,6 +163,7 @@ function install_batman { function_check configure_firewall_for_batman configure_firewall_for_batman + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-blog b/src/freedombone-app-blog index ff7734c1..9691a9d2 100755 --- a/src/freedombone-app-blog +++ b/src/freedombone-app-blog @@ -165,10 +165,11 @@ function install_interactive_blog { fi done - write_config_param "MY_BLOG_TITLE" "$MY_BLOG_TITLE" - write_config_param "FULLBLOG_DOMAIN_NAME" "$FULLBLOG_DOMAIN_NAME" write_config_param "FULLBLOG_CODE" "$FULLBLOG_CODE" fi + write_config_param "MY_BLOG_TITLE" "$MY_BLOG_TITLE" + write_config_param "FULLBLOG_DOMAIN_NAME" "$FULLBLOG_DOMAIN_NAME" + APP_INSTALLED=1 } function change_password_blog { @@ -675,6 +676,7 @@ function install_blog { if ! grep -q "blog domain:" $COMPLETION_FILE; then echo "blog domain:$FULLBLOG_DOMAIN_NAME" >> $COMPLETION_FILE fi + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-blogstatic b/src/freedombone-app-blogstatic index d9ca1f51..448fcde3 100755 --- a/src/freedombone-app-blogstatic +++ b/src/freedombone-app-blogstatic @@ -44,6 +44,7 @@ function configure_interactive_blogstatic { function install_interactive_blogstatic { echo -n '' + APP_INSTALLED=1 } function change_password_blogstatic { @@ -341,6 +342,7 @@ function install_blogstatic { chown -R $MY_USERNAME:$MY_USERNAME $STATIC_BLOG_INSTALL_DIR chown -R www-data:www-data $STATIC_BLOG_PATH + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-cjdns b/src/freedombone-app-cjdns index 4b22bd13..855cb15a 100755 --- a/src/freedombone-app-cjdns +++ b/src/freedombone-app-cjdns @@ -53,6 +53,7 @@ cjdns_variables=(MY_USERNAME function install_interactive_cjdns { echo -n '' + APP_INSTALLED=1 } function change_password_cjdns { @@ -546,6 +547,7 @@ function install_cjdns { install_cjdns_main install_cjdns_tools install_completed cjdns + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-dlna b/src/freedombone-app-dlna index 49f2481e..5a715295 100755 --- a/src/freedombone-app-dlna +++ b/src/freedombone-app-dlna @@ -62,6 +62,7 @@ function configure_interactive_dlna { function install_interactive_dlna { echo -n '' + APP_INSTALLED=1 } function change_password_dlna { @@ -264,6 +265,7 @@ function script_for_attaching_usb_drive { function install_dlna { install_dlna_main script_for_attaching_usb_drive + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-emacs b/src/freedombone-app-emacs index 23ac43f8..a464a94c 100755 --- a/src/freedombone-app-emacs +++ b/src/freedombone-app-emacs @@ -35,6 +35,7 @@ emacs_variables=(USB_MOUNT function install_interactive_emacs { echo -n '' + APP_INSTALLED=1 } function change_password_emacs { @@ -185,6 +186,7 @@ function install_emacs { echo '(epa-file-enable)' >> /home/$MY_USERNAME/.emacs cp /home/$MY_USERNAME/.emacs /root/.emacs chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.emacs + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-gnusocial b/src/freedombone-app-gnusocial index c38e7e21..24ba10d0 100755 --- a/src/freedombone-app-gnusocial +++ b/src/freedombone-app-gnusocial @@ -165,11 +165,12 @@ function install_interactive_gnusocial { fi done # save the results in the config file - write_config_param "MICROBLOG_DOMAIN_NAME" "$MICROBLOG_DOMAIN_NAME" write_config_param "MICROBLOG_CODE" "$MICROBLOG_CODE" write_config_param "MICROBLOG_WELCOME_MESSAGE" "$MICROBLOG_WELCOME_MESSAGE" write_config_param "MICROBLOG_BACKGROUND_IMAGE_URL" "$MICROBLOG_BACKGROUND_IMAGE_URL" fi + write_config_param "MICROBLOG_DOMAIN_NAME" "$MICROBLOG_DOMAIN_NAME" + APP_INSTALLED=1 } function change_password_gnusocial { @@ -1032,6 +1033,7 @@ function install_gnusocial { install_gnusocial_plugin_sharings install_gnusocial_plugin_sharings_theme install_gnusocial_plugin_nsfw + APP_INSTALLED=1 } # NOTE: deliberately there is no "exit 0" diff --git a/src/freedombone-app-gogs b/src/freedombone-app-gogs index 134a1dcf..e7135c80 100755 --- a/src/freedombone-app-gogs +++ b/src/freedombone-app-gogs @@ -104,9 +104,10 @@ function install_interactive_gogs { done # save the results in the config file - write_config_param "GIT_DOMAIN_NAME" "$GIT_DOMAIN_NAME" write_config_param "GIT_CODE" "$GIT_CODE" fi + write_config_param "GIT_DOMAIN_NAME" "$GIT_DOMAIN_NAME" + APP_INSTALLED=1 } function change_password_gogs { @@ -728,6 +729,7 @@ function install_gogs { else sed -i "s|gogs version.*|gogs version:${GOGS_VERSION}|g" ${COMPLETION_FILE} fi + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-hubzilla b/src/freedombone-app-hubzilla index 545f9ac3..d352e5a5 100755 --- a/src/freedombone-app-hubzilla +++ b/src/freedombone-app-hubzilla @@ -188,6 +188,7 @@ function install_interactive_hubzilla { # save the results in the config file write_config_param "HUBZILLA_DOMAIN_NAME" "$HUBZILLA_DOMAIN_NAME" write_config_param "HUBZILLA_CODE" "$HUBZILLA_CODE" + APP_INSTALLED=1 } function change_password_hubzilla { @@ -647,6 +648,7 @@ function install_hubzilla { ${PROJECT_NAME}-addemail -u $MY_USERNAME -e "noreply@$HUBZILLA_DOMAIN_NAME" -g hubzilla --public no echo "hubzilla domain:${HUBZILLA_DOMAIN_NAME}" >> $COMPLETION_FILE + APP_INSTALLED=1 } # NOTE: deliberately there is no "exit 0" diff --git a/src/freedombone-app-ipfs b/src/freedombone-app-ipfs index e28d10eb..74e23915 100755 --- a/src/freedombone-app-ipfs +++ b/src/freedombone-app-ipfs @@ -48,6 +48,7 @@ ipfs_variables=(IPFS_COMMIT function install_interactive_ipfs { echo -n '' + APP_INSTALLED=1 } function change_password_ipfs { @@ -601,4 +602,5 @@ function install_ipfs_go { function install_ipfs { #install_ipfs_js install_ipfs_go + APP_INSTALLED=1 } diff --git a/src/freedombone-app-irc b/src/freedombone-app-irc index 8db3e2da..e15ca45f 100755 --- a/src/freedombone-app-irc +++ b/src/freedombone-app-irc @@ -202,6 +202,7 @@ function configure_interactive_irc { function install_interactive_irc { echo -n '' + APP_INSTALLED=1 } function change_password_irc { @@ -458,6 +459,7 @@ function install_irc_client { function install_irc { install_irc_server install_irc_client + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-librevault b/src/freedombone-app-librevault index d2855f31..b25b0923 100755 --- a/src/freedombone-app-librevault +++ b/src/freedombone-app-librevault @@ -45,6 +45,7 @@ librevault_variables=(PROTOBUF_REPO function install_interactive_librevault { echo -n '' + APP_INSTALLED=1 } function change_password_librevault { @@ -324,6 +325,7 @@ function install_librevault { systemctl enable librevault-daemon systemctl start librevault-daemon + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-mediagoblin b/src/freedombone-app-mediagoblin index 7b7eca23..d280c434 100755 --- a/src/freedombone-app-mediagoblin +++ b/src/freedombone-app-mediagoblin @@ -99,9 +99,10 @@ function install_interactive_mediagoblin { done # save the results in the config file - write_config_param "MEDIAGOBLIN_DOMAIN_NAME" "$MEDIAGOBLIN_DOMAIN_NAME" write_config_param "MEDIAGOBLIN_CODE" "$MEDIAGOBLIN_CODE" fi + write_config_param "MEDIAGOBLIN_DOMAIN_NAME" "$MEDIAGOBLIN_DOMAIN_NAME" + APP_INSTALLED=1 } function change_password_mediagoblin { @@ -501,6 +502,7 @@ function install_mediagoblin { else sed -i "s/Mediagoblin domain.*/Mediagoblin domain:$MEDIAGOBLIN_DOMAIN_NAME/g" $COMPLETION_FILE fi + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-mumble b/src/freedombone-app-mumble index 9cadf916..fe7cdea3 100755 --- a/src/freedombone-app-mumble +++ b/src/freedombone-app-mumble @@ -47,6 +47,7 @@ mumble_variables=(MY_USERNAME function install_interactive_mumble { echo -n '' + APP_INSTALLED=1 } function change_password_mumble { @@ -281,6 +282,7 @@ function install_mumble { function_check configure_firewall_for_mumble configure_firewall_for_mumble + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-rss b/src/freedombone-app-rss index 2f013aec..587bdf23 100755 --- a/src/freedombone-app-rss +++ b/src/freedombone-app-rss @@ -53,6 +53,7 @@ rss_variables=(RSS_READER_REPO function install_interactive_rss { echo -n '' + APP_INSTALLED=1 } function change_password_rss { @@ -605,6 +606,7 @@ function install_rss { install_rss_main install_rss_gnusocial install_rss_mobile_reader + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-searx b/src/freedombone-app-searx index 944b7808..cdb6c8d7 100755 --- a/src/freedombone-app-searx +++ b/src/freedombone-app-searx @@ -47,6 +47,7 @@ searx_variables=(SEARX_REPO function install_interactive_searx { echo -n '' + APP_INSTALLED=1 } function change_password_searx { @@ -288,6 +289,7 @@ function install_searx { chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README chmod 600 /home/$MY_USERNAME/README fi + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-sip b/src/freedombone-app-sip index b7602d9d..c26286b8 100755 --- a/src/freedombone-app-sip +++ b/src/freedombone-app-sip @@ -86,6 +86,7 @@ function add_user_sip { function install_interactive_sip { echo -n '' + APP_INSTALLED=1 } function change_password_sip { @@ -498,6 +499,7 @@ function install_sip_turn { function install_sip { install_sip_main update_sipwitch_daemon + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-syncthing b/src/freedombone-app-syncthing index b30f28a1..05f6c0e0 100755 --- a/src/freedombone-app-syncthing +++ b/src/freedombone-app-syncthing @@ -222,6 +222,7 @@ function run_client_syncthing { function install_interactive_syncthing { echo -n '' + APP_INSTALLED=1 } function change_password_syncthing { @@ -560,6 +561,7 @@ function install_syncthing { function_check configure_firewall_for_syncthing configure_firewall_for_syncthing + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-tahoelafs b/src/freedombone-app-tahoelafs index 4d141afd..24c1b896 100755 --- a/src/freedombone-app-tahoelafs +++ b/src/freedombone-app-tahoelafs @@ -45,6 +45,7 @@ tahoelafs_variables=(TAHOELAFS_REPO function install_interactive_tahoelafs { echo -n '' + APP_INSTALLED=1 } function change_password_tahoelafs { @@ -357,6 +358,7 @@ function install_tahoelafs { systemctl enable tahoelafs systemctl daemon-reload systemctl start tahoelafs + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-tox b/src/freedombone-app-tox index b418b6c5..96b92ecd 100755 --- a/src/freedombone-app-tox +++ b/src/freedombone-app-tox @@ -100,6 +100,7 @@ function run_client_tox { function install_interactive_tox { echo -n '' + APP_INSTALLED=1 } function change_password_tox { @@ -706,6 +707,7 @@ function install_tox { tox_avahi install_tox_client fi + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-vpn b/src/freedombone-app-vpn index 217614ee..079c3614 100755 --- a/src/freedombone-app-vpn +++ b/src/freedombone-app-vpn @@ -34,6 +34,7 @@ vpn_variables=() function install_interactive_vpn { echo -n '' + APP_INSTALLED=1 } function change_password_vpn { @@ -83,6 +84,7 @@ function install_vpn { exit 52026 fi fi + APP_INSTALLED=1 } # NOTE: deliberately there is no "exit 0" diff --git a/src/freedombone-app-webmail b/src/freedombone-app-webmail index 46a457d8..34de6bc6 100755 --- a/src/freedombone-app-webmail +++ b/src/freedombone-app-webmail @@ -46,6 +46,7 @@ webmail_variables=(WEBMAIL_REPO function install_interactive_webmail { echo -n '' + APP_INSTALLED=1 } function change_password_webmail { @@ -259,6 +260,7 @@ function install_webmail { chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README chmod 600 /home/$MY_USERNAME/README fi + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-wiki b/src/freedombone-app-wiki index a258dc3e..33d59509 100755 --- a/src/freedombone-app-wiki +++ b/src/freedombone-app-wiki @@ -99,10 +99,11 @@ function install_interactive_wiki { done # save the results in the config file - write_config_param "WIKI_TITLE" "$WIKI_TITLE" - write_config_param "WIKI_DOMAIN_NAME" "$WIKI_DOMAIN_NAME" write_config_param "WIKI_CODE" "$WIKI_CODE" fi + write_config_param "WIKI_TITLE" "$WIKI_TITLE" + write_config_param "WIKI_DOMAIN_NAME" "$WIKI_DOMAIN_NAME" + APP_INSTALLED=1 } function change_password_wiki { @@ -614,6 +615,7 @@ function install_wiki { else sed -i "s|wiki domain.*|wiki domain:$WIKI_DOMAIN_NAME|g" $COMPLETION_FILE fi + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-xmpp b/src/freedombone-app-xmpp index cd1cbcea..47924e6f 100755 --- a/src/freedombone-app-xmpp +++ b/src/freedombone-app-xmpp @@ -96,6 +96,7 @@ function run_client_xmpp { function install_interactive_xmpp { echo -n '' + APP_INSTALLED=1 } function change_password_xmpp { @@ -554,6 +555,7 @@ function install_xmpp_client { function install_xmpp { install_xmpp_main install_xmpp_client + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-app-zeronet b/src/freedombone-app-zeronet index dce6b6a9..47c277d5 100755 --- a/src/freedombone-app-zeronet +++ b/src/freedombone-app-zeronet @@ -61,6 +61,7 @@ zeronet_variables=(ZERONET_BLOG_COMMIT function install_interactive_zeronet { echo -n '' + APP_INSTALLED=1 } function change_password_zeronet { @@ -686,6 +687,7 @@ function install_zeronet { install_zeronet_blog install_zeronet_mail install_zeronet_forum + APP_INSTALLED=1 } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-utils-selector b/src/freedombone-utils-selector index e9c10d01..81408b2f 100755 --- a/src/freedombone-utils-selector +++ b/src/freedombone-utils-selector @@ -402,10 +402,15 @@ function install_apps { echo $"${a} was upgraded from interactive" else echo $"Installing application from interactive: ${a}" + APP_INSTALLED= install_${a} - app_save_variables ${a} - install_completed ${a} - echo $"${a} was installed from interactive" + if [ $APP_INSTALLED ]; then + app_save_variables ${a} + install_completed ${a} + echo $"${a} was installed from interactive" + else + echo $"${a} was not installed from interactive" + fi fi else # check if the app was removed @@ -417,10 +422,15 @@ function install_apps { echo $"${a} was upgraded" else echo $"Installing application: ${a}" + APP_INSTALLED= install_${a} - app_save_variables ${a} - install_completed ${a} - echo $"${a} was installed" + if [ $APP_INSTALLED ]; then + app_save_variables ${a} + install_completed ${a} + echo $"${a} was installed" + else + echo $"${a} was not installed" + fi fi else echo $"${a} has been removed and so will not be reinstalled"