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

44 lines
1.3 KiB
Bash
Raw Permalink Normal View History

2021-03-11 00:34:24 +01:00
#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
# nodejs version
nodejs_version=12
#=================================================
# PERSONAL HELPERS
#=================================================
2024-02-28 22:22:42 +01:00
bool_to_str() {
bool_str=(false true)
2024-02-29 17:15:31 +01:00
echo "${bool_str[$1]}"
2024-02-28 22:22:42 +01:00
}
2021-03-11 00:34:24 +01:00
dato_setup_config_files() {
2024-03-13 01:36:40 +01:00
mkdir -p "$install_dir/sources/config/"
2024-02-28 22:22:42 +01:00
# setup public dato config
2024-03-13 01:36:40 +01:00
ynh_add_config --template="public.js" --destination="$install_dir/sources/config/public.js"
chmod 400 "$install_dir/sources/config/public.js"
chown "$app:$app" "$install_dir/sources/config/public.js"
2024-02-28 22:22:42 +01:00
# setup private dato config
if [[ $autosynchronize == true ]]; then
2024-03-13 01:36:40 +01:00
ynh_add_config --template="private-autosync.js" --destination="$install_dir/sources/config/private.js"
2024-02-28 22:22:42 +01:00
else
2024-03-13 01:36:40 +01:00
ynh_add_config --template="private.js" --destination="$install_dir/sources/config/private.js"
2024-02-28 22:22:42 +01:00
fi
2024-03-13 01:36:40 +01:00
chmod 400 "$install_dir/sources/config/private.js"
chown "$app:$app" "$install_dir/sources/config/private.js"
2021-03-11 00:34:24 +01:00
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================