1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/bozon_ynh.git synced 2024-09-03 18:16:09 +02:00

Solving App is broken #17 3

* Correct restore script `ynh_package_install_from_equivs`
* Change in each script `#! /bin/bash` with `#!/bin/bash`
* Correct `pathluaregex` in case of a installation on root
This commit is contained in:
ewilly 2017-01-08 12:17:57 +01:00
parent 4584047561
commit 16ef7053e6
5 changed files with 8 additions and 7 deletions

View file

@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu

View file

@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu
@ -126,7 +126,7 @@ then
ynh_app_setting_delete "$app" unprotected_uris
# escape magic chars in vars (lua magic chars are ().%+-*?[^$ according to https://www.lua.org/pil/20.2.html)
domainluaregex=$(echo "$domain" | sed -e 's/[]().%+*?[^$[]/\%&/g' | sed -e 's/\-/\%&/g')
pathluaregex=$(echo "$path" | sed -e 's/[]().%+*?[^$[]/\%&/g' | sed -e 's/\-/\%&/g')
pathluaregex=$([ "$path" == "/" ] || echo "$path" | sed -e 's/[]().%+*?[^$[]/\%&/g' | sed -e 's/\-/\%&/g')
regexList="${domainluaregex}${pathluaregex}/index.php%?f=.+$","${domainluaregex}${pathluaregex}/index.php%?zipfolder=.+$","${domainluaregex}${pathluaregex}/private/temp/.+%.zip$","${domainluaregex}${pathluaregex}/core/js/.*$","${domainluaregex}${pathluaregex}/templates/.*$"
ynh_app_setting_set "$app" unprotected_regex "$regexList"
sudo yunohost app ssowatconf

View file

@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu

View file

@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu
@ -39,7 +39,8 @@ sudo yunohost app checkurl $domain$path -a $app \
You should safely delete it before restoring this app."
# add required packages
ynh_package_install_from_equivs ../conf/${app}-deps.control || ynh_die "Unable to install dependencies"
ynh_package_is_installed "php5-curl" || ynh_package_install "php5-curl"
ynh_package_is_installed "php5-gd" || ynh_package_install "php5-gd"
# restore sources & data
sudo cp -a ./www "$final_path"

View file

@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu