mirror of
https://github.com/YunoHost-Apps/bozon_ynh.git
synced 2024-09-03 18:16:09 +02:00
Clean & refractoring
This commit is contained in:
parent
a5661f86e9
commit
057daa700a
5 changed files with 10 additions and 13 deletions
|
@ -6,8 +6,8 @@
|
|||
set -eu
|
||||
if [ ! -e _common.sh ]; then
|
||||
# Get the _common.sh file if it's not in the current directory
|
||||
sudo cp ../settings/scripts/_common.sh ./_common.sh
|
||||
sudo chmod a+rx _common.sh
|
||||
cp ../settings/scripts/_common.sh ./_common.sh
|
||||
chmod a+rx _common.sh
|
||||
fi
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
|
|
@ -93,7 +93,6 @@ myynh_add_fpm_config
|
|||
|
||||
# set temporary public access for curl call
|
||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||
yunohost app ssowatconf
|
||||
|
||||
# fill the superadmin creation form (helper ynh_local_curl doesn't work due to --data vs --data-urlencode ?)
|
||||
curl --silent --show-error -kL -H "Host: $domain" --resolve $domain:443:127.0.0.1 https://localhost"$path_url"/ > /dev/null 2>&1
|
||||
|
@ -113,5 +112,4 @@ then
|
|||
pathluaregex=$([ "$path_url" == "/" ] || echo "$path_url" | sed -e 's/[]().%+*?[^$[]/\%&/g' | sed -e 's/\-/\%&/g')
|
||||
regexList="${domainluaregex}${pathluaregex}/index%.php$","${domainluaregex}${pathluaregex}/index%.php%?p=.*$"
|
||||
ynh_app_setting_set "$app" protected_regex "$regexList"
|
||||
yunohost app ssowatconf
|
||||
fi
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
set -u
|
||||
if [ ! -e _common.sh ]; then
|
||||
# Get the _common.sh file if it's not in the current directory
|
||||
sudo cp ../settings/scripts/_common.sh ./_common.sh
|
||||
sudo chmod a+rx _common.sh
|
||||
cp ../settings/scripts/_common.sh ./_common.sh
|
||||
chmod a+rx _common.sh
|
||||
fi
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
@ -25,10 +25,10 @@ nginx_conf="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
phpfpm_conf="/etc/php5/fpm/pool.d/$app.conf"
|
||||
|
||||
# create a full backup (core+datas) if app installed
|
||||
if [ $(sudo yunohost app list -i -f "$app" | wc -l) -gt 1 ]; then
|
||||
if [ $(yunohost app list -i -f "$app" | wc -l) -gt 1 ]; then
|
||||
ynh_app_setting_set "$app" backup_core_only 0
|
||||
app_bck=${app//_/-}
|
||||
sudo yunohost backup create --ignore-system --apps "$app" --name "${app_bck}_$(date '+%Y%m%d-%H%M%S')"
|
||||
yunohost backup create --ignore-system --apps "$app" --name "${app_bck}_$(date '+%Y%m%d-%H%M%S')"
|
||||
echo "BoZon fully backuped." >&2
|
||||
fi
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
set -eu
|
||||
if [ ! -e _common.sh ]; then
|
||||
# Fetch helpers file if not in current directory
|
||||
sudo cp ../settings/scripts/_common.sh ./_common.sh
|
||||
sudo chmod a+rx _common.sh
|
||||
cp ../settings/scripts/_common.sh ./_common.sh
|
||||
chmod a+rx _common.sh
|
||||
fi
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
@ -61,5 +61,5 @@ fi
|
|||
myynh_set_permissions
|
||||
|
||||
# restart services
|
||||
sudo systemctl reload php5-fpm
|
||||
sudo systemctl reload nginx
|
||||
systemctl reload php5-fpm
|
||||
systemctl reload nginx
|
||||
|
|
|
@ -81,7 +81,6 @@ then
|
|||
else
|
||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||
fi
|
||||
yunohost app ssowatconf
|
||||
|
||||
# Purge php sessions stored in /var/lib/php5/sessions
|
||||
[ -x /usr/lib/php5/sessionclean ] && /usr/lib/php5/sessionclean
|
||||
|
|
Loading…
Reference in a new issue