[mod] tabulations inside f()

This commit is contained in:
Moul 2018-11-29 17:32:21 +01:00
parent 3e379d9fa8
commit f266234ee6
1 changed files with 34 additions and 36 deletions

View File

@ -1,22 +1,21 @@
#/bin/bash
INSTALL_DUNITER_DEBIAN_PACKAGE () {
version="v1.6.25"
git_repo="https://git.duniter.org/nodes/typescript/duniter/"
if [ $arch == "x64" ]; then
middle_url="-/jobs/7062/artifacts/raw/work/bin/"
else
middle_url="uploads/722c2b2901e0c2a13ca3595eae4e696f/"
fi
deb="duniter-server-$version-linux-$arch.deb"
url="${git_repo}${middle_url}${deb}"
version="v1.6.25"
git_repo="https://git.duniter.org/nodes/typescript/duniter/"
if [ $arch == "x64" ]; then
middle_url="-/jobs/7062/artifacts/raw/work/bin/"
else
middle_url="uploads/722c2b2901e0c2a13ca3595eae4e696f/"
fi
deb="duniter-server-$version-linux-$arch.deb"
url="${git_repo}${middle_url}${deb}"
# Retrieve debian package and install it
wget -nc --quiet $url -P /tmp
deb_path="/tmp/$deb"
dpkg -i $deb_path > /dev/null
rm -f $deb_path
# Retrieve debian package and install it
wget -nc --quiet $url -P /tmp
deb_path="/tmp/$deb"
dpkg -i $deb_path > /dev/null
rm -f $deb_path
}
CONFIGURE_DUNITER () {
@ -26,35 +25,34 @@ CONFIGURE_DUNITER () {
}
CONFIG_SSOWAT () {
# Add admin to the allowed users
yunohost app addaccess $app -u $admin
# Add admin to the allowed users
yunohost app addaccess $app -u $admin
# Protect senstive sub-routes
ynh_app_setting_set "$app" protected_uris "/webui","/webmin"
# Protect senstive sub-routes
ynh_app_setting_set "$app" protected_uris "/webui","/webmin"
# Duniter is public app, with only some parts restricted in nginx.conf
ynh_app_setting_set "$app" unprotected_uris "/","/modules"
# Duniter is public app, with only some parts restricted in nginx.conf
ynh_app_setting_set "$app" unprotected_uris "/","/modules"
# Set URL redirection from root to webadmin
ynh_app_setting_set "$app" redirected_urls "{'$domain/':'$domain/webui'}"
# Set URL redirection from root to webadmin
ynh_app_setting_set "$app" redirected_urls "{'$domain/':'$domain/webui'}"
}
CONFIG_NGINX () {
# Configure Nginx
nginx_conf="../conf/nginx.conf"
sed -i "s@YNH_EXAMPLE_PORT@$port@" $nginx_conf
sed -i "s@YNH_EXAMPLE_DOMAIN@$domain@" $nginx_conf
cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
service nginx reload
nginx_conf="../conf/nginx.conf"
sed -i "s@YNH_EXAMPLE_PORT@$port@" $nginx_conf
sed -i "s@YNH_EXAMPLE_DOMAIN@$domain@" $nginx_conf
cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
service nginx reload
}
REMOVE_DUNITER () {
# Stop duniter daemon if running
duniter status
if [ `echo "$?"` == 0 ]; then
duniter stop
fi
# Stop duniter daemon if running
duniter status
if [ `echo "$?"` == 0 ]; then
duniter stop
fi
# Remove Duniter package
dpkg -r duniter
# Remove Duniter package
dpkg -r duniter
}