From b2563528ee868cbe17801175aa6f50824ba6dd7a Mon Sep 17 00:00:00 2001 From: EinerVonVielen Date: Sun, 13 Mar 2016 02:37:38 +0100 Subject: Added installation of extended plugins and themes to homeinstall script --- .homeinstall/hubzilla-setup.sh | 74 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) (limited to '.homeinstall/hubzilla-setup.sh') diff --git a/.homeinstall/hubzilla-setup.sh b/.homeinstall/hubzilla-setup.sh index 670844b83..87b0e8f79 100755 --- a/.homeinstall/hubzilla-setup.sh +++ b/.homeinstall/hubzilla-setup.sh @@ -236,7 +236,7 @@ function install_curl { function install_sendmail { print_info "installing sendmail..." - nocheck_install "sendmail" + nocheck_install "sendmail sendmail-bin" } function install_php { @@ -561,7 +561,8 @@ function install_hubzilla { chmod -R 777 store touch .htconfig.php chmod ou+w .htconfig.php - cd .. + install_hubzilla_plugins + cd /var/www/ chown -R www-data:www-data html chown root:www-data /var/www/html/ chown root:www-data /var/www/html/.htaccess @@ -575,6 +576,73 @@ function install_hubzilla { print_info "installed hubzilla" } +function install_hubzilla_plugins { + print_info "installing hubzilla plugins..." + cd /var/www/html + plugin_install=.homeinstall/plugin_install.txt + theme_install=.homeinstall/theme_install.txt + # overwrite script to update the plugin and themes + rm -f $plugins_update + echo "cd /var/www/html" >> $plugins_update + ################### + # write plugin file + if [ ! -f "$plugin_install" ] + then + echo "# To install a plugin" >> $plugin_install + echo "# 1. add the plugin in a new line and run" >> $plugin_install + echo "# 2. run" >> $plugin_install + echo "# cd /var/www/html/.homeinstall" >> $plugin_install + echo "# ./hubzilla-setup.sh" >> $plugin_install + echo "https://gitlab.com/zot/ownmapp.git ownMap" >> $plugin_install + echo "https://gitlab.com/zot/hubzilla-chess.git chess" >> $plugin_install + fi + # install plugins + while read -r line; do + [[ "$line" =~ ^#.*$ ]] && continue + p_url=$(echo $line | awk -F' ' '{print $1}') + p_name=$(echo $line | awk -F' ' '{print $2}') + # basic check of format + if [ ${#p_url} -ge 1 ] && [ ${#p_name} -ge 1 ] + then + # install addon + util/add_addon_repo $line + util/update_addon_repo $p_name # not sure if this line is neccessary + echo "util/update_addon_repo $p_name" >> $plugins_update + else + print_info "skipping installation of a plugin from file $plugin_install - something wrong with format in line: $line" + fi + done < "$plugin_install" + ################### + # write theme file + if [ ! -f "$theme_install" ] + then + echo "# To install a theme" >> $theme_install + echo "# 1. add the theme in a new line and run" >> $theme_install + echo "# 2. run" >> $theme_install + echo "# cd /var/www/html/.homeinstall" >> $theme_install + echo "# ./hubzilla-setup.sh" >> $theme_install + echo "https://github.com/DeadSuperHero/hubzilla-themes.git DeadSuperHeroThemes" >> $theme_install + + fi + # install plugins + while read -r line; do + [[ "$line" =~ ^#.*$ ]] && continue + p_url=$(echo $line | awk -F' ' '{print $1}') + p_name=$(echo $line | awk -F' ' '{print $2}') + # basic check of format + if [ ${#p_url} -ge 1 ] && [ ${#p_name} -ge 1 ] + then + # install addon + util/add_theme_repo $line + util/update_theme_repo $p_name # not sure if this line is neccessary + echo "util/update_theme_repo $p_name" >> $plugins_update + else + print_info "skipping installation of a theme from file $theme_install - something wrong with format in line: $line" + fi + done < "$theme_install" + print_info "installed hubzilla plugins and themes" +} + function rewrite_to_https { print_info "configuring apache to redirect http to httpS ..." htaccessfile=/var/www/html/.htaccess @@ -762,6 +830,7 @@ echo "echo \"\$(date) - updating hubhilla core...\"" >> /var/www/$hubzilladaily echo "git -C /var/www/html/ pull" >> /var/www/$hubzilladaily echo "echo \"\$(date) - updating hubhilla addons...\"" >> /var/www/$hubzilladaily echo "git -C /var/www/html/addon/ pull" >> /var/www/$hubzilladaily +echo "bash /var/www/html/$plugins_update" >> /var/www/$hubzilladaily echo "chown -R www-data:www-data /var/www/html/ # make all accessable for the webserver" >> /var/www/$hubzilladaily echo "chown root:www-data /var/www/html/.htaccess" >> /var/www/$hubzilladaily echo "chmod 0644 /var/www/html/.htaccess # www-data can read but not write it" >> /var/www/$hubzilladaily @@ -827,6 +896,7 @@ source $configfile selfhostdir=/etc/selfhost selfhostscript=selfhost-updater.sh hubzilladaily=hubzilla-daily.sh +plugins_update=.homeinstall/plugins_update.sh snapshotconfig=/etc/rsnapshot_hubzilla.conf snapshotconfig_external_device=/etc/rsnapshot_hubzilla_external_device.conf backup_mount_point=/media/hubzilla_backup -- cgit v1.2.3 From c5736708218c78e67422aadaba256f8a6802e076 Mon Sep 17 00:00:00 2001 From: EinerVonVielen Date: Sun, 13 Mar 2016 16:32:34 +0100 Subject: Install script: Added plugin hubsites and stop of apache, mysql --- .homeinstall/hubzilla-setup.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to '.homeinstall/hubzilla-setup.sh') diff --git a/.homeinstall/hubzilla-setup.sh b/.homeinstall/hubzilla-setup.sh index 87b0e8f79..01acb1ec9 100755 --- a/.homeinstall/hubzilla-setup.sh +++ b/.homeinstall/hubzilla-setup.sh @@ -224,6 +224,19 @@ function print_warn { echo -e '\e[0m' } +function stop_hubzilla { + if [ -d /etc/apache2 ] + then + print_info "stopping apache webserver..." + service apache2 stop + fi + if [ -f /etc/init.d/mysql ] + then + print_info "stopping mysql db..." + /etc/init.d/mysql stop + fi +} + function install_apache { print_info "installing apache..." nocheck_install "apache2 apache2-utils" @@ -906,6 +919,7 @@ sslconf=/etc/apache2/sites-available/default-ssl.conf #set -x # activate debugging from here check_config +stop_hubzilla update_upgrade install_curl install_sendmail -- cgit v1.2.3