mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
c695e37cbc
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
34 lines
1.3 KiB
Bash
Executable File
34 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium>
|
|
#
|
|
# This is free software, licensed under the MIT License.
|
|
# See /LICENSE for more information.
|
|
#
|
|
|
|
cp -f /usr/bin/arcdns.php /usr/syno/bin/ddns/arcdns.php
|
|
|
|
ENTRIES=("[ArcDNS.tech]")
|
|
for ENTRY in "${ENTRIES[@]}"
|
|
do
|
|
if [ -f "/etc/ddns_provider.conf" ]; then
|
|
if grep -Fxq "${ENTRY}" /etc/ddns_provider.conf; then
|
|
echo "arcdns: Entry ${ENTRY} already exists"
|
|
else
|
|
echo "arcdns: Entry ${ENTRY} does not exist, adding now"
|
|
echo "${ENTRY}" >> /etc/ddns_provider.conf
|
|
echo " modulepath=/usr/syno/bin/ddns/arcdns.php" >> /etc/ddns_provider.conf
|
|
echo " queryurl=https://arcdns.tech/update/__HOSTNAME__/__PASSWORD__" >> /etc/ddns_provider.conf
|
|
fi
|
|
fi
|
|
if [ -f "/etc.defaults/ddns_provider.conf" ]; then
|
|
if grep -Fxq "${ENTRY}" /etc.defaults/ddns_provider.conf; then
|
|
echo "arcdns: Entry ${ENTRY} already exists"
|
|
else
|
|
echo "arcdns: Entry ${ENTRY} does not exist, adding now"
|
|
echo "${ENTRY}" >> /etc.defaults/ddns_provider.conf
|
|
echo " modulepath=/usr/syno/bin/ddns/arcdns.php" >> /etc.defaults/ddns_provider.conf
|
|
echo " queryurl=https://arcdns.tech/update/__HOSTNAME__/__PASSWORD__" >> /etc.defaults/ddns_provider.conf
|
|
fi
|
|
fi
|
|
done |