From 885f3c5f3fedda8529e49be2783ae280673dedc2 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 16 Feb 2020 23:11:46 +0800 Subject: [PATCH] keep custom cert when sysupgrade --- Makefile | 2 +- root/etc/init.d/unblockneteasemusic | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 19f72bd6..b7ecbd20 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ LUCI_DEPENDS:=+bash +busybox +coreutils-nohup +curl +dnsmasq-full +ipset +libope LUCI_PKGARCH:=all PKG_NAME:=luci-app-unblockneteasemusic PKG_VERSION:=2.7 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_MAINTAINER:=[CTCGFW]Project-OpenWrt diff --git a/root/etc/init.d/unblockneteasemusic b/root/etc/init.d/unblockneteasemusic index 9a3266c7..cbab70c2 100755 --- a/root/etc/init.d/unblockneteasemusic +++ b/root/etc/init.d/unblockneteasemusic @@ -140,8 +140,8 @@ start() sed -i -e "1i const key = '${youtube_key}'" "/usr/share/unblockneteasemusic/core/src/provider/youtube.js" fi - { [ -f "${self_issue_cert_crt}" ] && [ "${self_issue_cert_crt}" != "/usr/share/unblockneteasemusic/core/server.crt" ]; } && ln -sf "${self_issue_cert_crt}" "/usr/share/unblockneteasemusic/core/server.crt" - { [ -f "${self_issue_cert_key}" ] && [ "${self_issue_cert_key}" != "/usr/share/unblockneteasemusic/core/server.key" ]; } && ln -sf "${self_issue_cert_key}" "/usr/share/unblockneteasemusic/core/server.key" + { [ -f "${self_issue_cert_crt}" ] && [ "${self_issue_cert_crt}" != "/usr/share/unblockneteasemusic/core/server.crt" ]; } && { ln -sf "${self_issue_cert_crt}" "/usr/share/unblockneteasemusic/core/server.crt"; sed -i "#${self_issue_cert_crt}#d"; echo "${self_issue_cert_crt}" >> "/etc/sysupgrade.conf"; } + { [ -f "${self_issue_cert_key}" ] && [ "${self_issue_cert_key}" != "/usr/share/unblockneteasemusic/core/server.key" ]; } && { ln -sf "${self_issue_cert_key}" "/usr/share/unblockneteasemusic/core/server.key"; sed -i "#${self_issue_cert_key}#d"; echo "${self_issue_cert_key}" >> "/etc/sysupgrade.conf"; } [ "${hijack_ways}" = "use_hosts" ] && { http_port="80"; https_port="443"; } if [ "${music_source}" = "default" ]; then @@ -172,7 +172,7 @@ stop() sed -i '/unblockneteasemusic/d' "/etc/crontabs/root" /etc/init.d/cron restart > "/dev/null" 2>&1 - sed -i '/unblockneteasemusic/d' "/etc/sysupgrade.conf" + sed -i '#unblockneteasemusic/core#d' "/etc/sysupgrade.conf" [ "${keep_core_when_upgrade}" -eq "1" ] && { echo "/usr/share/unblockneteasemusic/core/" >> "/etc/sysupgrade.conf"; echo "/usr/share/unblockneteasemusic/local_ver" >> "/etc/sysupgrade.conf"; } rm -f "/tmp/unblockneteasemusic.log"