Skip to content

Commit

Permalink
tree: rework
Browse files Browse the repository at this point in the history
Signed-off-by: AuxXxilium <[email protected]>
  • Loading branch information
AuxXxilium committed Aug 24, 2024
1 parent daec6b6 commit 84505c7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
13 changes: 8 additions & 5 deletions files/initrd/opt/arc/arc-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -693,25 +693,28 @@ function arcDNSMenu() {
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
if [ "${CONFDONE}" == "true" ]; then
while true; do
ARCDNS="$(readConfigKey "arc.dns" "${USER_CONFIG_FILE}")"
ARCDNS="$(readConfigKey "addons.arcdns" "${USER_CONFIG_FILE}")"
domain="$(echo ${ARCDNS} | cut -d'/' -f1)"
token="$(echo ${ARCDNS} | cut -d'/' -f2)"
MSG="Register your Subdomain at arcdns.tech\n"
MSG+="Enter the Values from ArcDNS below:\n"
dialog --backtitle "$(backtitle)" --title "Add DSM User" \
--form "${MSG}" 8 60 3 "Domain:" 1 1 "domain" 1 10 50 0 "Token:" 2 1 "token" 2 10 50 0 \
--form "${MSG}" 8 60 3 "Domain:" 1 1 "${domain:-domain}" 1 10 50 0 "Token:" 2 1 "${token:-token}" 2 10 50 0 \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && break
domain="$(cat "${TMP_PATH}/resp" | sed -n '1p')"
token="$(cat "${TMP_PATH}/resp" | sed -n '2p')"
if [ -z "${domain}" ] || [ -z "${token}" ]; then
if [ -z "${domain}" ] || [ -z "${token}" ] || [ "${domain}" = "domain" ] || [ "${token}" = "token" ]; then
dialog --backtitle "$(backtitle)" --title "ArcDNS" \
--infobox "Invalid Domain or Token, retry!" 0 0
deleteConfigKey "addons.arcdns" "${USER_CONFIG_FILE}"
sleep 3
continue
else
ARCDNS="https://arcdns.tech/update/${domain}/${token}"
ARCDNS="${domain}/${token}"
dialog --backtitle "$(backtitle)" --colors --title "ArcDNS" \
--msgbox "ArcDNS set successful!" 0 0
writeConfigKey "arc.dns" "${ARCDNS}" "${USER_CONFIG_FILE}"
writeConfigKey "addons.arcdns" "${ARCDNS}" "${USER_CONFIG_FILE}"
break
fi
done
Expand Down
2 changes: 1 addition & 1 deletion files/initrd/opt/arc/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ else
writeConfigKey "automated" "false" "${USER_CONFIG_FILE}"
fi
if [ -f "${PART1_PATH}/ARC-BRANCH" ]; then
ARCBRANCH=$(cat "${PART1_PATH}/ARC-BRANCH") && writeConfigKey "arc.branch" "ARCBRANCH" "${USER_CONFIG_FILE}"
ARCBRANCH=$(cat "${PART1_PATH}/ARC-BRANCH") && writeConfigKey "arc.branch" "${ARCBRANCH}" "${USER_CONFIG_FILE}"
rm -f "${PART1_PATH}/ARC-BRANCH" >/dev/null 2>&1 || true
fi
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null 2>&1 || true
Expand Down
2 changes: 0 additions & 2 deletions files/initrd/opt/arc/ramdisk-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ for ADDON in "redpill" "revert" "misc" "eudev" "disks" "localrss" "notify" "upda
[ -f "${USER_UP_PATH}/${MODEL}.dts" ] && cp -f "${USER_UP_PATH}/${MODEL}.dts" "${RAMDISK_PATH}/addons/model.dts"
elif [ "${ADDON}" == "cpufreqscaling" ]; then
PARAMS=${CPUGOVERNOR}
elif [ "${ADDON}" == "arcdns" ]; then
PARAMS=${ARCDNS}
fi
installAddon "${ADDON}" "${PLATFORM}" || exit 1
echo "/addons/${ADDON}.sh \${1} ${PARAMS}" >>"${RAMDISK_PATH}/addons/addons.sh" 2>>"${LOG_FILE}" || exit 1
Expand Down

0 comments on commit 84505c7

Please sign in to comment.