[fix] Unable to extract tarball

This commit is contained in:
ljf 2016-12-14 11:46:00 +01:00
parent 7bb3ab96a8
commit 40f007a4c4
2 changed files with 13 additions and 12 deletions

View file

@ -24,9 +24,13 @@ sudo yunohost app checkurl $domain -a $app \
# Remove trailing "/" for next commands # Remove trailing "/" for next commands
domain=${domain%/} domain=${domain%/}
# Generate random password
# Fix a bug on ynh_string_random https://github.com/YunoHost/yunohost/pull/205/commits/0d6cf499a0b858e7009245fd11a9210188047c13
dbpass=$(ynh_string_random | sed "s/\[/e/g" | sed "s/\]/e/g")
ynh_app_setting_set "$app" domain "$domain" ynh_app_setting_set "$app" domain "$domain"
ynh_app_setting_set "$app" lang "$lang" ynh_app_setting_set "$app" lang "$lang"
ynh_app_setting_set "$app" psqlpwd "$dbpass"
if [ -f /usr/bin/openerp-server ]; then if [ -f /usr/bin/openerp-server ]; then
@ -41,13 +45,9 @@ else
echo "Installing odoo" echo "Installing odoo"
# Generate random password
# Fix a bug on ynh_string_random https://github.com/YunoHost/yunohost/pull/205/commits/0d6cf499a0b858e7009245fd11a9210188047c13
dbpass=$(ynh_string_random | sed "s/\[/e/g" | sed "s/\]/e/g")
ynh_app_setting_set "$app" version "$odoo_version" ynh_app_setting_set "$app" version "$odoo_version"
ynh_app_setting_set "$app" instance "master" ynh_app_setting_set "$app" instance "master"
ynh_app_setting_set "$app" psqlpwd "$dbpass"
# Install Odoo # Install Odoo
# Prepare installation # Prepare installation
@ -69,8 +69,10 @@ else
ynh_package_install xfonts-75dpi xfonts-base wkhtmltopdf ynh_package_install xfonts-75dpi xfonts-base wkhtmltopdf
# The debian package has a bug so we deploy a more recent version # The debian package has a bug so we deploy a more recent version
extract_sources "/usr/" "$app" DESTDIR="/tmp/wkhtmltox/"
mkdir -p $DESTDIR
extract_sources $DESTDIR "$app"
mv "$DESTDIR." /usr/
# Set admin password # Set admin password

View file

@ -16,23 +16,22 @@ database=${domain//./-}
instance=$(ynh_app_setting_get "$app" instance) instance=$(ynh_app_setting_get "$app" instance)
sudo yunohost service stop odoo sudo yunohost service stop odoo | true
# If removing master instance, remove Odoo. # If removing master instance, remove Odoo.
if [ "$instance" = "master" ]; then if [ "$instance" = "master" ]; then
sudo rm -f /etc/apt/sources.list.d/odoo.list sudo rm -f /etc/apt/sources.list.d/odoo.list
sudo apt-get update sudo apt-get update
ynh_package_remove odoo ynh_package_remove odoo
ynh_package_remove wkhtmltopdf
sudo rm -f /etc/odoo/openerp-server.conf sudo rm -f /etc/odoo/openerp-server.conf
sudo yunohost service remove odoo sudo yunohost service remove odoo | true
fi fi
# Remove database # Remove database
ynh_psql_drop_db $database ynh_psql_drop_db $database | true
ynh_psql_drop_user $database ynh_psql_drop_user $database | true
if [ "$instance" = "slave" ]; then if [ "$instance" = "slave" ]; then
sudo yunohost service start odoo sudo yunohost service start odoo | true
fi fi
# Remove NGINX conf # Remove NGINX conf
sudo rm /etc/nginx/conf.d/$domain.d/$app.conf sudo rm /etc/nginx/conf.d/$domain.d/$app.conf