From 8da67b6229105ce48e524a52d37ac541d9d43102 Mon Sep 17 00:00:00 2001 From: user Date: Sun, 7 Mar 2021 14:58:22 +0100 Subject: [PATCH] fix bugs in installer --- install.sh | 14 ++++++++------ version | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 version diff --git a/install.sh b/install.sh index 3d69de4..4f0aea0 100755 --- a/install.sh +++ b/install.sh @@ -112,7 +112,7 @@ echo_header "Copy over application files" mkdir -vp "$install_dir" cp -rv "$script_dir/$default_app_name/." "$install_dir" sed -i "s+^app_name=.*+app_name='${flask_module_name}'+g" "$install_dir/run.sh" -sed -i "s+confuse.Configuration(*, __name__)+confuse.Configuration('$app_name', __name__)'+g" "$install_dir/{$flask_module_name}/__init__.py" +sed -i "s+confuse.Configuration(*, __name__)+confuse.Configuration('$app_name', __name__)'+g" "$install_dir/$flask_module_name/__init__.py" cp -v "$script_dir/installation-files/uninstall.sh" "$install_dir" sed -i "s+^app_name=.*+app_name='${app_name}'+g" "$install_dir/uninstall.sh" @@ -122,10 +122,12 @@ cp -v "$script_dir/version" "$install_dir" cp -v "$script_dir/README.md" "$install_dir" mkdir -vp "/etc/$app_name" -cp -v "$script_dir/$default_app_name/config_example.yaml" "/etc/$app_name/config.yaml" -sed -i "s/^port =.*/port = $internal_port/g" "$install_dir/config.yaml" -sed -i "s+^logfile :.*+logfile : $logging_dir/reports.log+g" "$install_dir/config.yaml" -sed -i "s+^errorfile :.*+errorfile : $logging_dir/error.log+g" "$install_dir/config.yaml" +cp -v "$script_dir/installation-files/config_example.yaml" "/etc/$app_name/config.yaml" +sed -i "s/^port =.*/port = $internal_port/g" "$install_dir/$flask_module_name/config_default.yaml" +sed -i "s+^logfile :.*+logfile : $logging_dir/reports.log+g" "$install_dir/$flask_module_name/config_default.yaml" +sed -i "s+^errorfile :.*+errorfile : $logging_dir/error.log+g" "$install_dir/$flask_module_name/config_default.yaml" + +cp -v "$script_dir/installation-files/projects_example.yaml" "/etc/$app_name/projects.yaml" echo_header "Copy over and enable apache vhost" @@ -139,7 +141,7 @@ if [ "$use_wsgi" = 'true' ]; then echo_header "Installing wsgi-script" mkdir -vp "/var/www/wsgi-scripts" - cp -v "$script_dir/installation-files/$default_app_name.wsgi" "/var/www/wsgi-scripts/app_name.wsgi" + cp -v "$script_dir/installation-files/$default_app_name.wsgi" "/var/www/wsgi-scripts/$app_name.wsgi" sed -i "s+INSTALLDIR+$install_dir+g" "/var/www/wsgi-scripts/$app_name.wsgi" sed -i "s/APPNAME/$flask_module_name/g" "/var/www/wsgi-scripts/$app_name.wsgi" else diff --git a/version b/version new file mode 100644 index 0000000..3eefcb9 --- /dev/null +++ b/version @@ -0,0 +1 @@ +1.0.0