functions: move to correct file

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-11-16 00:35:56 +01:00
parent cee2d7d263
commit 8bc3393d55
2 changed files with 17 additions and 14 deletions

View File

@ -1609,17 +1609,6 @@ function loaderPorts() {
RET=$? RET=$?
case ${RET} in case ${RET} in
0) # ok-button 0) # ok-button
function check_port() {
if [ -z "${1}" ]; then
return 0
else
if [[ "${1}" =~ ^[0-9]+$ ]] && [ "${1}" -ge 0 ] && [ "${1}" -le 65535 ]; then
return 0
else
return 1
fi
fi
}
HTTPPORT=$(sed -n '1p' "${TMP_PATH}/resp") HTTPPORT=$(sed -n '1p' "${TMP_PATH}/resp")
DUFSPORT=$(sed -n '2p' "${TMP_PATH}/resp") DUFSPORT=$(sed -n '2p' "${TMP_PATH}/resp")
TTYDPORT=$(sed -n '3p' "${TMP_PATH}/resp") TTYDPORT=$(sed -n '3p' "${TMP_PATH}/resp")
@ -1631,9 +1620,9 @@ function loaderPorts() {
[ $? -eq 0 ] && continue || break [ $? -eq 0 ] && continue || break
fi fi
rm -f "/etc/arc.conf" rm -f "/etc/arc.conf"
[ ! "${HTTPPORT:-8080}" = "8080" ] && echo "HTTP_PORT=${HTTPPORT}" >>"/etc/arc.conf" && /etc/init.d/S90thttpd restart >/dev/null 2>&1 if [ ! "${HTTPPORT:-8080}" = "8080" ]; then echo "HTTP_PORT=${HTTPPORT}" >>"/etc/arc.conf"; /etc/init.d/S90thttpd restart >/dev/null 2>&1; fi
[ ! "${DUFSPORT:-7304}" = "7304" ] && echo "DUFS_PORT=${DUFSPORT}" >>"/etc/arc.conf" && /etc/init.d/S99dufs restart >/dev/null 2>&1 if [ ! "${DUFSPORT:-7304}" = "7304" ]; then echo "DUFS_PORT=${DUFSPORT}" >>"/etc/arc.conf"; /etc/init.d/S99dufs restart >/dev/null 2>&1; fi
[ ! "${TTYDPORT:-7681}" = "7681" ] && echo "TTYD_PORT=${TTYDPORT}" >>"/etc/arc.conf" && /etc/init.d/S99ttyd restart >/dev/null 2>&1 if [ ! "${TTYDPORT:-7681}" = "7681" ]; then echo "TTYD_PORT=${TTYDPORT}" >>"/etc/arc.conf"; /etc/init.d/S99ttyd restart >/dev/null 2>&1; fi
RDXZ_PATH="${TMP_PATH}/rdxz_tmp" RDXZ_PATH="${TMP_PATH}/rdxz_tmp"
rm -rf "${RDXZ_PATH}" rm -rf "${RDXZ_PATH}"
mkdir -p "${RDXZ_PATH}" mkdir -p "${RDXZ_PATH}"

View File

@ -568,3 +568,17 @@ function genHWID () {
HWID="$(echo $(dmidecode -t 4 | grep ID | sed 's/.*ID://;s/ //g' | head -1) $(ifconfig | grep eth | awk '{print $NF}' | sed 's/://g' | sort | head -1) | sha256sum | awk '{print $1}' | cut -c1-16)" 2>/dev/null HWID="$(echo $(dmidecode -t 4 | grep ID | sed 's/.*ID://;s/ //g' | head -1) $(ifconfig | grep eth | awk '{print $NF}' | sed 's/://g' | sort | head -1) | sha256sum | awk '{print $1}' | cut -c1-16)" 2>/dev/null
echo "${HWID}" echo "${HWID}"
} }
###############################################################################
# Check if port is valid
function check_port() {
if [ -z "${1}" ]; then
return 0
else
if [[ "${1}" =~ ^[0-9]+$ ]] && [ "${1}" -ge 0 ] && [ "${1}" -le 65535 ]; then
return 0
else
return 1
fi
fi
}