Browse Source

Simplify install state checking

stockholm
Bob Mottram 5 years ago
parent
commit
4956701174
  1. 4
      src/freedombone-app-babel
  2. 4
      src/freedombone-app-batman
  3. 6
      src/freedombone-app-blog
  4. 6
      src/freedombone-app-blogstatic
  5. 5
      src/freedombone-app-cjdns
  6. 4
      src/freedombone-app-dlna
  7. 5
      src/freedombone-app-emacs
  8. 5
      src/freedombone-app-gnusocial
  9. 5
      src/freedombone-app-gogs
  10. 5
      src/freedombone-app-hubzilla
  11. 4
      src/freedombone-app-irc
  12. 6
      src/freedombone-app-librevault
  13. 35
      src/freedombone-app-mediagoblin
  14. 4
      src/freedombone-app-mumble
  15. 4
      src/freedombone-app-rss
  16. 6
      src/freedombone-app-searx
  17. 4
      src/freedombone-app-sip
  18. 5
      src/freedombone-app-syncthing
  19. 6
      src/freedombone-app-tahoelafs
  20. 8
      src/freedombone-app-tox
  21. 4
      src/freedombone-app-vpn
  22. 5
      src/freedombone-app-webmail
  23. 5
      src/freedombone-app-wiki
  24. 4
      src/freedombone-app-xmpp
  25. 4
      src/freedombone-app-zeronet
  26. 26
      src/freedombone-utils-selector

4
src/freedombone-app-babel

@ -100,9 +100,6 @@ function configure_firewall_for_babel {
}
function install_babel {
if [[ $(app_is_installed babel) == "1" ]]; then
return
fi
if [[ $ENABLE_BABEL != "yes" ]]; then
return
fi
@ -115,7 +112,6 @@ function install_babel {
function_check configure_firewall_for_babel
configure_firewall_for_babel
install_completed babel
}
# NOTE: deliberately there is no "exit 0"

4
src/freedombone-app-batman

@ -135,9 +135,6 @@ function install_batman {
mesh_install_batman
return
fi
if [[ $(app_is_installed batman) == "1" ]]; then
return
fi
if [[ $ENABLE_BATMAN != "yes" ]]; then
return
fi
@ -162,7 +159,6 @@ function install_batman {
function_check configure_firewall_for_batman
configure_firewall_for_batman
install_completed batman
}
# NOTE: deliberately no exit 0

6
src/freedombone-app-blog

@ -590,10 +590,6 @@ function install_blog_from_repo {
}
function install_blog {
if [[ $(app_is_installed blog) == "1" ]]; then
return
fi
if [ ! $ONION_ONLY ]; then
ONION_ONLY='no'
fi
@ -675,8 +671,6 @@ function install_blog {
if ! grep -q "Blog domain:" $COMPLETION_FILE; then
echo "Blog domain:$FULLBLOG_DOMAIN_NAME" >> $COMPLETION_FILE
fi
install_completed blog
}
# NOTE: deliberately no exit 0

6
src/freedombone-app-blogstatic

@ -305,10 +305,6 @@ function install_blogstatic {
return
fi
if [[ $(app_is_installed blogstatic) == "1" ]]; then
return
fi
apt-get -y install python-pip
pip install ipython
pip install Markdown
@ -342,8 +338,6 @@ function install_blogstatic {
chown -R $MY_USERNAME:$MY_USERNAME $STATIC_BLOG_INSTALL_DIR
chown -R www-data:www-data $STATIC_BLOG_PATH
install_completed blogstatic
}
# NOTE: deliberately no exit 0

5
src/freedombone-app-cjdns

@ -529,13 +529,10 @@ function install_cjdns_tools {
# initialise from the cjdns config
/usr/bin/cjdcmd cjdnsadmin -file /etc/cjdns/cjdroute.conf
echo 'install_cjdns_tools' >> $COMPLETION_FILE
install_completed cjdns_tools
}
function install_cjdns {
if [[ $(app_is_installed cjdns) == "1" ]]; then
return
fi
install_cjdns_main
install_cjdns_tools
install_completed cjdns

4
src/freedombone-app-dlna

@ -257,12 +257,8 @@ function script_for_attaching_usb_drive {
}
function install_dlna {
if [[ $(app_is_installed dlna) == "1" ]]; then
return
fi
install_dlna_main
script_for_attaching_usb_drive
install_completed dlna
}
# NOTE: deliberately no exit 0

5
src/freedombone-app-emacs

@ -108,9 +108,6 @@ function remove_emacs {
}
function install_emacs {
if [[ $(app_is_installed emacs) == "1" ]]; then
return
fi
update-alternatives --set editor /usr/bin/emacs24
# A minimal emacs configuration
@ -185,8 +182,6 @@ 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
install_completed emacs
}
# NOTE: deliberately no exit 0

5
src/freedombone-app-gnusocial

@ -1011,10 +1011,6 @@ function install_gnusocial_plugin_nsfw {
}
function install_gnusocial {
if [[ $(app_is_installed gnusocial) == "1" ]]; then
return
fi
if [ ! $ONION_ONLY ]; then
ONION_ONLY='no'
fi
@ -1044,7 +1040,6 @@ function install_gnusocial {
install_gnusocial_plugin_sharings
install_gnusocial_plugin_sharings_theme
install_gnusocial_plugin_nsfw
install_completed gnusocial
}
# NOTE: deliberately there is no "exit 0"

5
src/freedombone-app-gogs

@ -442,10 +442,6 @@ function install_gogs {
return
fi
if [[ $(app_is_installed gogs) == "1" ]]; then
return
fi
adduser --disabled-login --gecos 'Gogs' $GOGS_USERNAME
gogs_parameters
@ -766,7 +762,6 @@ function install_gogs {
else
sed -i "s|Gogs version.*|Gogs version:$GOGS_VERSION|g" $COMPLETION_FILE
fi
install_completed gogs
}
# NOTE: deliberately no exit 0

5
src/freedombone-app-hubzilla

@ -400,10 +400,6 @@ function install_hubzilla {
return
fi
if [[ $(app_is_installed hubzilla) == "1" ]]; then
return
fi
HUBZILLA_PATH=/var/www/$HUBZILLA_DOMAIN_NAME/htdocs
function_check install_mariadb
@ -704,7 +700,6 @@ 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
install_completed hubzilla
}
# NOTE: deliberately there is no "exit 0"

4
src/freedombone-app-irc

@ -371,12 +371,8 @@ function install_irc_client {
}
function install_irc {
if [[ $(app_is_installed irc) == "1" ]]; then
return
fi
install_irc_server
install_irc_client
install_completed irc
}
# NOTE: deliberately no exit 0

6
src/freedombone-app-librevault

@ -231,10 +231,6 @@ function install_librevault {
return
fi
if [[ $(app_is_installed librevault) == "1" ]]; then
return
fi
install_tracker
install_cmake
install_cryptopp
@ -326,8 +322,6 @@ function install_librevault {
systemctl enable librevault-daemon
systemctl start librevault-daemon
install_completed librevault
}
# NOTE: deliberately no exit 0

35
src/freedombone-app-mediagoblin

@ -128,7 +128,34 @@ function reconfigure_mediagoblin {
}
function upgrade_mediagoblin {
echo -n ''
if [ ! $ONION_ONLY ]; then
ONION_ONLY='no'
fi
if grep -q "ONION_ONLY" $CONFIGURATION_FILE; then
ONION_ONLY=$(grep "ONION_ONLY" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "MEDIAGOBLIN_DOMAIN_NAME" $CONFIGURATION_FILE; then
MEDIAGOBLIN_DOMAIN_NAME=$(grep "MEDIAGOBLIN_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "MEDIAGOBLIN_CODE" $CONFIGURATION_FILE; then
MEDIAGOBLIN_CODE=$(grep "MEDIAGOBLIN_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "DDNS_PROVIDER" $CONFIGURATION_FILE; then
DDNS_PROVIDER=$(grep "DDNS_PROVIDER" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if [ ! $MEDIAGOBLIN_DOMAIN_NAME ]; then
return
fi
MEDIAGOBLIN_WORKING_DIRECTORY=/var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs
# update to a new commit if needed
function_check set_repo_commit
set_repo_commit $MEDIAGOBLIN_WORKING_DIRECTORY "Mediagoblin commit" "$MEDIAGOBLIN_COMMIT" $MEDIAGOBLIN_REPO
if [ -d $MEDIAGOBLIN_WORKING_DIRECTORY ]; then
chown -hR mediagoblin:www-data $MEDIAGOBLIN_WORKING_DIRECTORY
fi
}
function backup_local_mediagoblin {
@ -209,10 +236,6 @@ function install_mediagoblin {
chown -hR mediagoblin:www-data $MEDIAGOBLIN_WORKING_DIRECTORY
fi
if [[ $(app_is_installed mediagoblin) == "1" ]]; then
return
fi
apt-get -y install git-core python python-dev python-lxml python-pil
apt-get -y install python-virtualenv npm nodejs-legacy automake
apt-get -y install fcgiwrap
@ -531,8 +554,6 @@ function install_mediagoblin {
else
sed -i "s/Mediagoblin domain.*/Mediagoblin domain:$MEDIAGOBLIN_DOMAIN_NAME/g" $COMPLETION_FILE
fi
install_completed mediagoblin
}
# NOTE: deliberately no exit 0

4
src/freedombone-app-mumble

@ -199,9 +199,6 @@ function configure_firewall_for_voip {
}
function install_mumble {
if [[ $(app_is_installed mumble) == "1" ]]; then
return
fi
apt-get -y install mumble-server
function_check get_voip_server_password
@ -289,7 +286,6 @@ function install_mumble {
function_check configure_firewall_for_voip
configure_firewall_for_voip
install_completed mumble
}
# NOTE: deliberately no exit 0

4
src/freedombone-app-rss

@ -617,13 +617,9 @@ function install_rss_mobile_reader {
}
function install_rss {
if [[ $(app_is_installed rss) == "1" ]]; then
return
fi
install_rss_main
install_rss_gnusocial
install_rss_mobile_reader
install_completed rss
}
# NOTE: deliberately no exit 0

6
src/freedombone-app-searx

@ -122,10 +122,6 @@ function install_searx {
exit 62429
fi
if [[ $(app_is_installed searx) == "1" ]]; then
return
fi
apt-get -y install python-pip libyaml-dev python-werkzeug python-babel python-lxml apache2-utils
apt-get -y install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev uwsgi uwsgi-plugin-python libapache2-mod-uwsgi
@ -292,8 +288,6 @@ function install_searx {
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
chmod 600 /home/$MY_USERNAME/README
fi
install_completed searx
}
# NOTE: deliberately no exit 0

4
src/freedombone-app-sip

@ -446,12 +446,8 @@ function install_sip_turn {
}
function install_sip {
if [[ $(app_is_installed sip) == "1" ]]; then
return
fi
install_sip_main
update_sipwitch_daemon
install_completed sip
}
# NOTE: deliberately no exit 0

5
src/freedombone-app-syncthing

@ -470,10 +470,6 @@ function install_syncthing {
return
fi
if [[ $(app_is_installed syncthing) == "1" ]]; then
return
fi
apt-get -y install curl
curl -s https://syncthing.net/release-key.txt | apt-key add -
@ -508,7 +504,6 @@ function install_syncthing {
function_check configure_firewall_for_syncthing
configure_firewall_for_syncthing
install_completed syncthing
}
# NOTE: deliberately no exit 0

6
src/freedombone-app-tahoelafs

@ -292,10 +292,6 @@ function install_tahoelafs {
return
fi
if [[ $(app_is_installed tahoelafs) == "1" ]]; then
return
fi
apt-get -y install build-essential python-pip python-dev libffi-dev libssl-dev python-virtualenv
# create a user to run the introducer
@ -357,8 +353,6 @@ function install_tahoelafs {
systemctl enable tahoelafs
systemctl daemon-reload
systemctl start tahoelafs
install_completed tahoelafs
}
# NOTE: deliberately no exit 0

8
src/freedombone-app-tox

@ -661,12 +661,6 @@ function enable_tox_repo {
}
function install_tox {
if [ ! $INSTALLING_MESH ]; then
if [[ $(app_is_installed tox) == "1" ]]; then
return
fi
fi
configure_firewall_for_tox
if [ $INSTALLING_MESH ]; then
@ -678,8 +672,6 @@ function install_tox {
tox_avahi
install_tox_client
fi
install_completed tox
}
# NOTE: deliberately no exit 0

4
src/freedombone-app-vpn

@ -68,9 +68,6 @@ function remove_vpn {
}
function install_vpn {
if [[ $(app_is_installed vpn) == "1" ]]; then
return
fi
if ! grep -q "repo.universe-factory.net" /etc/apt/sources.list; then
echo 'deb http://repo.universe-factory.net/debian/ sid main' >> /etc/apt/sources.list
gpg --keyserver pgpkeys.mit.edu --recv-key 16EF3F64CB201D9C
@ -84,7 +81,6 @@ function install_vpn {
exit 52026
fi
fi
install_completed vpn
}
# NOTE: deliberately there is no "exit 0"

5
src/freedombone-app-webmail

@ -138,9 +138,6 @@ function remove_webmail {
}
function install_webmail {
if [[ $(app_is_installed webmail) == "1" ]]; then
return
fi
if [ -d /etc/apache2 ]; then
rm -rf /etc/apache2
echo $'Removed Apache installation after Dokuwiki install'
@ -259,8 +256,6 @@ function install_webmail {
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
chmod 600 /home/$MY_USERNAME/README
fi
install_completed webmail
}
# NOTE: deliberately no exit 0

5
src/freedombone-app-wiki

@ -270,10 +270,6 @@ function get_wiki_admin_password {
}
function install_wiki {
if [[ $(app_is_installed wiki) == "1" ]]; then
return
fi
if [ ! $ONION_ONLY ]; then
ONION_ONLY='no'
fi
@ -657,7 +653,6 @@ function install_wiki {
fi
echo "Wiki domain:$WIKI_DOMAIN_NAME" >> $COMPLETION_FILE
install_completed wiki
}
# NOTE: deliberately no exit 0

4
src/freedombone-app-xmpp

@ -502,12 +502,8 @@ function install_xmpp_client {
}
function install_xmpp {
if [[ $(app_is_installed xmpp) == "1" ]]; then
return
fi
install_xmpp_main
install_xmpp_client
install_completed xmpp
}
# NOTE: deliberately no exit 0

4
src/freedombone-app-zeronet

@ -675,14 +675,10 @@ function install_zeronet {
mesh_zeronet_forum
return
fi
if [[ $(app_is_installed zeronet) == "1" ]]; then
return
fi
install_zeronet_main
install_zeronet_blog
install_zeronet_mail
install_zeronet_forum
install_completed zeronet
}
# NOTE: deliberately no exit 0

26
src/freedombone-utils-selector

@ -310,15 +310,29 @@ function install_apps {
# clears any removal indicator
reinstall_app ${a}
echo $"Installing application from interactive: ${a}"
install_${a}
echo $"${a} was installed from interactive"
if [[ $(app_is_installed ${a}) == "1" ]]; then
echo $"Upgrading application from interactive: ${a}"
upgrade_${a}
echo $"${a} was upgraded from interactive"
else
echo $"Installing application from interactive: ${a}"
install_${a}
install_completed ${a}
echo $"${a} was installed from interactive"
fi
else
# check if the app was removed
if [[ $(app_is_removed ${a}) == "0" ]]; then
echo $"Installing application: ${a}"
install_${a}
echo $"${a} was installed"
if [[ $(app_is_installed ${a}) == "1" ]]; then
echo $"Upgrading application: ${a}"
upgrade_${a}
echo $"${a} was upgraded"
else
echo $"Installing application: ${a}"
install_${a}
install_completed ${a}
echo $"${a} was installed"
fi
else
echo $"${a} has been removed and so will not be reinstalled"
fi

Loading…
Cancel
Save