diff --git a/src/freedombone-app-blog b/src/freedombone-app-blog index 7044a442..e46a2df6 100755 --- a/src/freedombone-app-blog +++ b/src/freedombone-app-blog @@ -180,9 +180,10 @@ function reconfigure_blog { } function upgrade_blog { - if ! grep -Fxq "install_blog" $COMPLETION_FILE; then - return + if grep -q "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then + FULLBLOG_DOMAIN_NAME=$(grep "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') fi + function_check set_repo_commit set_repo_commit /var/www/$FULLBLOG_DOMAIN_NAME/htdocs "Blog commit" "$FULLBLOG_COMMIT" $FULLBLOG_REPO diff --git a/src/freedombone-app-gnusocial b/src/freedombone-app-gnusocial index d44bbfcb..e6d6ff08 100755 --- a/src/freedombone-app-gnusocial +++ b/src/freedombone-app-gnusocial @@ -222,8 +222,8 @@ function reconfigure_gnusocial { } function upgrade_gnusocial { - if ! grep -Fxq "install_gnusocial_main" $COMPLETION_FILE; then - return + if grep -q "GNU Social domain" $COMPLETION_FILE; then + MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | head -n 1 | awk -F ':' '{print $2}') fi # update to the next commit diff --git a/src/freedombone-app-gogs b/src/freedombone-app-gogs index a25358d2..7cd62344 100755 --- a/src/freedombone-app-gogs +++ b/src/freedombone-app-gogs @@ -183,10 +183,6 @@ function reconfigure_gogs { } function upgrade_gogs { - if ! grep -Fxq "install_gogs" $COMPLETION_FILE; then - return - fi - if ! grep -q "Gogs version:" $COMPLETION_FILE; then return fi diff --git a/src/freedombone-app-hubzilla b/src/freedombone-app-hubzilla index fd91df15..36e4adee 100755 --- a/src/freedombone-app-hubzilla +++ b/src/freedombone-app-hubzilla @@ -250,9 +250,10 @@ function reconfigure_hubzilla { } function upgrade_hubzilla { - if ! grep -Fxq "install_hubzilla" $COMPLETION_FILE; then - return + if grep -q "HUBZILLA_DOMAIN_NAME" $CONFIGURATION_FILE; then + HUBZILLA_DOMAIN_NAME=$(grep "HUBZILLA_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') fi + HUBZILLA_PATH=/var/www/$HUBZILLA_DOMAIN_NAME/htdocs function_check set_repo_commit diff --git a/src/freedombone-app-ipfs b/src/freedombone-app-ipfs index 7685fb33..d8386590 100755 --- a/src/freedombone-app-ipfs +++ b/src/freedombone-app-ipfs @@ -54,7 +54,7 @@ function reconfigure_ipfs { } function upgrade_ipfs_go { - if ! grep -Fxq "install_ipfs_go" $COMPLETION_FILE; then + if [[ $(app_is_installed ipfs_go) == "0" ]]; then return fi @@ -63,7 +63,7 @@ function upgrade_ipfs_go { } function upgrade_ipfs_js { - if ! grep -Fxq "install_ipfs_js" $COMPLETION_FILE; then + if [[ $(app_is_installed ipfs_js) == "0" ]]; then return fi diff --git a/src/freedombone-app-irc b/src/freedombone-app-irc index 65f5e15d..3759d2f8 100755 --- a/src/freedombone-app-irc +++ b/src/freedombone-app-irc @@ -186,7 +186,7 @@ function configure_firewall_for_irc { } function install_irc_server { - if grep -Fxq "install_irc_server" $COMPLETION_FILE; then + if [[ $(app_is_installed irc_server) == "1" ]]; then return fi apt-get -y install ngircd @@ -293,7 +293,7 @@ function install_irc_server { } function install_irc_client { - if grep -Fxq "install_irc_client" $COMPLETION_FILE; then + if [[ $(app_is_installed irc_client) == "1" ]]; then return fi apt-get -y install irssi diff --git a/src/freedombone-app-librevault b/src/freedombone-app-librevault index ff8e8ac2..88e0208b 100755 --- a/src/freedombone-app-librevault +++ b/src/freedombone-app-librevault @@ -51,10 +51,6 @@ function reconfigure_librevault { } function upgrade_librevault { - if ! grep -Fxq "install_librevault" $COMPLETION_FILE; then - return - fi - function_check set_repo_commit if [ -d $INSTALL_DIR/protobuf ]; then diff --git a/src/freedombone-app-searx b/src/freedombone-app-searx index 250b33bd..105a367f 100755 --- a/src/freedombone-app-searx +++ b/src/freedombone-app-searx @@ -51,10 +51,6 @@ function reconfigure_searx { } function upgrade_searx { - if ! grep -Fxq "install_searx" $COMPLETION_FILE; then - return - fi - set_repo_commit $SEARX_PATH/searx "Search engine commit" "$SEARX_COMMIT" $SEARX_REPO if grep "Search engine key" $COMPLETION_FILE; then if [ -f ${SEARX_PATH}/searx/searx/settings.yml ]; then diff --git a/src/freedombone-app-sip b/src/freedombone-app-sip index f34d64ff..2ff498db 100755 --- a/src/freedombone-app-sip +++ b/src/freedombone-app-sip @@ -221,7 +221,7 @@ function update_sipwitch_daemon { } function install_sip_main { - if grep -Fxq "install_sip_main" $COMPLETION_FILE; then + if [[ $(app_is_installed sip_main) == "1" ]]; then return fi @@ -301,11 +301,11 @@ function install_sip_main { function_check configure_firewall_for_sip4 configure_firewall_for_sip4 - echo 'install_sip_main' >> $COMPLETION_FILE + install_completed sip_main } function install_sip_turn { - if grep -Fxq "install_sip_turn" $COMPLETION_FILE; then + if [[ $(app_is_installed sip_turn) == "1" ]]; then return fi @@ -442,7 +442,7 @@ function install_sip_turn { function_check configure_firewall_for_voip_turn configure_firewall_for_voip_turn - echo 'install_sip_turn' >> $COMPLETION_FILE + install_completed sip_turn } function install_sip { diff --git a/src/freedombone-app-tox b/src/freedombone-app-tox index 1b475b57..e7a32d13 100755 --- a/src/freedombone-app-tox +++ b/src/freedombone-app-tox @@ -105,9 +105,6 @@ function reconfigure_tox { } function upgrade_tox { - if ! grep -Fxq "install_tox" $COMPLETION_FILE; then - return - fi function_check set_repo_commit set_repo_commit $INSTALL_DIR/toxcore "toxcore commit" "$TOXCORE_COMMIT" $TOXCORE_REPO @@ -316,7 +313,7 @@ function tox_avahi { } function install_tox_node { - if grep -Fxq "install_tox_node" $COMPLETION_FILE; then + if [[ $(app_is_installed tox_node) == "1" ]]; then return fi @@ -355,18 +352,18 @@ function install_tox_node { function_check configure_firewall_for_tox configure_firewall_for_tox - echo 'install_tox_node' >> $COMPLETION_FILE + install_completed tox_node } function install_tox_client { - if grep -Fxq "install_tox_client" $COMPLETION_FILE; then + if [[ $(app_is_installed tox_client) == "1" ]]; then return fi function_check mesh_tox_client mesh_tox_client - echo 'install_tox_client' >> $COMPLETION_FILE + install_completed tox_client } function mesh_tox_node { diff --git a/src/freedombone-app-webmail b/src/freedombone-app-webmail index 4c7e55d1..a7332e5a 100755 --- a/src/freedombone-app-webmail +++ b/src/freedombone-app-webmail @@ -76,9 +76,6 @@ function reconfigure_webmail { } function upgrade_webmail { - if ! grep -Fxq "install_webmail" $COMPLETION_FILE; then - return - fi function_check set_repo_commit set_repo_commit $WEBMAIL_PATH "Webmail commit" "$WEBMAIL_COMMIT" $WEBMAIL_REPO } diff --git a/src/freedombone-app-xmpp b/src/freedombone-app-xmpp index ff1de050..53108357 100755 --- a/src/freedombone-app-xmpp +++ b/src/freedombone-app-xmpp @@ -117,9 +117,6 @@ function update_prosody_modules { } function upgrade_xmpp { - if ! grep -Fxq "install_xmpp_main" $COMPLETION_FILE; then - return - fi function_check update_prosody_modules update_prosody_modules } @@ -259,7 +256,7 @@ function xmpp_email_headers { function install_xmpp_main { update_prosody_modules - if grep -Fxq "install_xmpp_main" $COMPLETION_FILE; then + if [[ $(app_is_installed xmpp_main) == "1" ]]; then return fi apt-get -y install lua-sec lua-bitop @@ -431,11 +428,11 @@ function install_xmpp_main { configure_firewall_for_xmpp xmpp_email_headers - echo 'install_xmpp_main' >> $COMPLETION_FILE + install_completed xmpp_main } function install_xmpp_client { - if grep -Fxq "install_xmpp_client" $COMPLETION_FILE; then + if [[ $(app_is_installed xmpp_client) == "1" ]]; then return fi apt-get -y install profanity @@ -498,7 +495,7 @@ function install_xmpp_client { chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.local chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.config - echo 'install_xmpp_client' >> $COMPLETION_FILE + install_completed xmpp_client } function install_xmpp { diff --git a/src/freedombone-app-zeronet b/src/freedombone-app-zeronet index 5f8e481a..0e716c4c 100755 --- a/src/freedombone-app-zeronet +++ b/src/freedombone-app-zeronet @@ -62,9 +62,6 @@ function reconfigure_zeronet { } function upgrade_zeronet { - if ! grep -Fxq "install_zeronet" $COMPLETION_FILE; then - return - fi function_check set_repo_commit set_repo_commit $MESH_INSTALL_DIR/zeronet "ZeroNet commit" "$ZERONET_COMMIT" $ZERONET_REPO 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 { } function install_zeronet_blog { - if grep -Fxq "install_zeronet_blog" $COMPLETION_FILE; then + if [[ $(app_is_installed zeronet_blog) == "1" ]]; then return fi @@ -256,10 +253,11 @@ function install_zeronet_blog { echo "ZeroNet Blog private key: $ZERONET_BLOG_PRIVATE_KEY" >> /home/$MY_USERNAME/README fi - echo 'install_zeronet_blog' >> $COMPLETION_FILE + install_completed zeronet_blog } function install_zeronet_mail { + if [[ $(app_is_installed zeronet_mail) == "1" ]]; then if grep -Fxq "install_zeronet_mail" $COMPLETION_FILE; then return fi @@ -357,11 +355,11 @@ function install_zeronet_mail { echo $"ZeroNet Mail private key: $ZERONET_MAIL_PRIVATE_KEY" >> /home/$MY_USERNAME/README fi - echo 'install_zeronet_mail' >> $COMPLETION_FILE + install_completed zeronet_mail } function install_zeronet_forum { - if grep -Fxq "install_zeronet_forum" $COMPLETION_FILE; then + if [[ $(app_is_installed zeronet_forum) == "1" ]]; then return fi @@ -452,11 +450,11 @@ function install_zeronet_forum { echo $"ZeroNet Forum private key: $ZERONET_FORUM_PRIVATE_KEY" >> /home/$MY_USERNAME/README fi - echo 'install_zeronet_forum' >> $COMPLETION_FILE + install_completed zeronet_forum } function install_zeronet_main { - if grep -Fxq "install_zeronet_main" $COMPLETION_FILE; then + if [[ $(app_is_installed zeronet_main) == "1" ]]; then return fi @@ -467,7 +465,7 @@ function install_zeronet_main { function_check configure_firewall_for_zeronet configure_firewall_for_zeronet - echo 'install_zeronet_main' >> $COMPLETION_FILE + install_completed zeronet_main } function mesh_zeronet {