2019-11-19 13:09:31 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# dependencies used by the app
|
2020-10-04 23:27:41 +02:00
|
|
|
pkg_dependencies="python3-dbus python3-crypto python3-paramiko python3-yaml python3-dnspython python3-requests-toolbelt python3-spf whois smartmontools"
|
2019-11-19 13:09:31 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
ynh_export () {
|
|
|
|
local ynh_arg=""
|
|
|
|
for var in $@;
|
|
|
|
do
|
|
|
|
ynh_arg=$(echo $var | awk '{print toupper($0)}')
|
|
|
|
if [ "$var" == "path_url" ]; then
|
|
|
|
ynh_arg="PATH"
|
|
|
|
fi
|
|
|
|
ynh_arg="YNH_APP_ARG_$ynh_arg"
|
|
|
|
export $var="${!ynh_arg}"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
# Save listed var in YunoHost app settings
|
|
|
|
# usage: ynh_save_args VARNAME1 [VARNAME2 [...]]
|
|
|
|
ynh_save_args () {
|
|
|
|
for var in $@;
|
|
|
|
do
|
|
|
|
local setting_var="$var"
|
|
|
|
if [ "$var" == "path_url" ]; then
|
|
|
|
setting_var="path"
|
|
|
|
fi
|
|
|
|
ynh_app_setting_set "$app" "$setting_var" "${!var}"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
|
|
|
#=================================================
|