Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
publicarray committed Jul 22, 2021
1 parent 6ec2d29 commit f84fa33
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions spk/dnscrypt-proxy/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ SYNOPKG_PKGHOME="${SYNOPKG_PKGHOME:=$SYNOPKG_PKGVAR}"
SERVICE_COMMAND="env HOME=${SYNOPKG_PKGHOME} ${DNSCRYPT_PROXY} --config ${CFG_FILE} --pidfile ${PID_FILE}"
SVC_BACKGROUND=y

# find OS
OS="dsm"
if echo "$UNAME" | grep -q -i 'rt1900ac\|rt2600ac\|mr2200ac'; then
OS="srm"
fi
echo "OS detected: $OS"
## end

default_config () {
# if [ servicetool --conf-port-conflict-check --tcp 53]
sed -i -e "s/listen_addresses\s*=.*/listen_addresses = \['0.0.0.0:$SERVICE_PORT'\]/" \
Expand All @@ -31,7 +39,7 @@ migrate_files () { # from 2.0.44 to 2.0.45
mv "${SYNOPKG_PKGVAR}/domains-blacklist.conf" "${SYNOPKG_PKGVAR}/domains-blocklist.conf"
fi
if [ -f "${SYNOPKG_PKGVAR}/generate-domains-blacklist.py" ]; then
mv "${SYNOPKG_PKGVAR}/generate-domains-blacklist.py" "${SYNOPKG_PKGVAR}/generate-domains-blocklist.py"
rm "${SYNOPKG_PKGVAR}/generate-domains-blacklist.py"
fi
if [ -f "${SYNOPKG_PKGVAR}/domains-blacklist-local-additions.txt" ]; then
mv "${SYNOPKG_PKGVAR}/domains-blacklist-local-additions.txt" "${SYNOPKG_PKGVAR}/domains-blocklist-local-additions.txt"
Expand Down Expand Up @@ -100,13 +108,12 @@ service_postinst () {
mv "${file}" "${file//example-/}"
done
default_config

# allow synocommuity group access (synoedit)
chmod g+rw -R "$SYNOPKG_PKGVAR"

fi

blocklist_setup

# allow synocommuity group access (synoedit)
chmod g+rw -R "$SYNOPKG_PKGVAR"
}

service_postuninst () {
Expand All @@ -131,5 +138,5 @@ service_postuninst () {
service_postupgrade () {
migrate_files # from 2.0.44 to 2.0.45
# upgrade script
cp -f "${SYNOPKG_PKGDEST}"/blocklist/generate-domains-blocklist.py "${SYNOPKG_PKGVAR}/"
cp -f "${SYNOPKG_PKGDEST}/blocklist/generate-domains-blocklist.py" "${SYNOPKG_PKGVAR}/"
}

0 comments on commit f84fa33

Please sign in to comment.