1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/adguardhome_ynh.git synced 2024-09-03 18:06:23 +02:00
adguardhome_ynh/scripts/upgrade

53 lines
1.6 KiB
Text
Raw Normal View History

2019-01-09 09:31:49 +01:00
#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu
# See comments in install script
app=$YNH_APP_INSTANCE_NAME
final_path=/opt/yunohost/$app
2019-11-28 10:17:34 +01:00
date=$(date +%Y.%m.%d_%H-%M-%S)
2019-01-09 09:31:49 +01:00
# Source YunoHost helpers
source /usr/share/yunohost/helpers
2019-11-28 10:19:29 +01:00
cp -a /opt/yunohost/"$app"/AdGuardHome.yaml /opt/yunohost/"$app"/AdGuardHome.yaml."$date".bak
2019-07-28 10:42:10 +02:00
2019-01-09 09:31:49 +01:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2019-11-28 10:19:29 +01:00
ynh_app_setting_set "$app" final_path "$final_path"
2020-05-23 13:25:24 +02:00
# Download, check integrity, uncompress and patch the source from app-[arch].src
case $(uname -m) in
x86_64) ynh_setup_source "$final_path" "app-amd64" ;;
aarch64) ynh_setup_source "$final_path" "app-arm64" ;;
armv7l) ynh_setup_source "$final_path" "app-arm" ;;
*) ynh_die "Unknown arch" ;;
esac
2019-01-09 09:31:49 +01:00
#=================================================
# NGINX CONFIGURATION
#=================================================
# Create a dedicated nginx config
#ynh_add_nginx_config
#=================================================
# UPGRADE CONFIG
#=================================================
#cp -a ../conf/loolwsd.xml /etc/loolwsd
#ynh_replace_string "__NEXTCLOUDDOMAIN__" "$nextcloud_domain" "/etc/loolwsd/loolwsd.xml"
#ynh_replace_string "__PASSWORD__" "$password" "/etc/loolwsd/loolwsd.xml"
#systemctl restart loolwsd
# If app is public, add url to SSOWat conf as skipped_uris
#if [[ $is_public -eq 1 ]]; then
# See install script
# ynh_app_setting_set "$app" unprotected_uris "/"
#fi
2019-07-02 12:11:55 +02:00
# Start Adguard service
2019-07-28 10:33:29 +02:00
systemctl restart adguard