mirror of
https://github.com/AuxXxilium/arc.git
synced 2024-11-23 18:59:54 +07:00
functions: move to correct file
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
cee2d7d263
commit
8bc3393d55
@ -1609,17 +1609,6 @@ function loaderPorts() {
|
||||
RET=$?
|
||||
case ${RET} in
|
||||
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")
|
||||
DUFSPORT=$(sed -n '2p' "${TMP_PATH}/resp")
|
||||
TTYDPORT=$(sed -n '3p' "${TMP_PATH}/resp")
|
||||
@ -1631,9 +1620,9 @@ function loaderPorts() {
|
||||
[ $? -eq 0 ] && continue || break
|
||||
fi
|
||||
rm -f "/etc/arc.conf"
|
||||
[ ! "${HTTPPORT:-8080}" = "8080" ] && echo "HTTP_PORT=${HTTPPORT}" >>"/etc/arc.conf" && /etc/init.d/S90thttpd restart >/dev/null 2>&1
|
||||
[ ! "${DUFSPORT:-7304}" = "7304" ] && echo "DUFS_PORT=${DUFSPORT}" >>"/etc/arc.conf" && /etc/init.d/S99dufs restart >/dev/null 2>&1
|
||||
[ ! "${TTYDPORT:-7681}" = "7681" ] && echo "TTYD_PORT=${TTYDPORT}" >>"/etc/arc.conf" && /etc/init.d/S99ttyd 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
|
||||
if [ ! "${DUFSPORT:-7304}" = "7304" ]; then echo "DUFS_PORT=${DUFSPORT}" >>"/etc/arc.conf"; /etc/init.d/S99dufs restart >/dev/null 2>&1; fi
|
||||
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"
|
||||
rm -rf "${RDXZ_PATH}"
|
||||
mkdir -p "${RDXZ_PATH}"
|
||||
|
@ -567,4 +567,18 @@ function systemCheck () {
|
||||
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
|
||||
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
|
||||
}
|
Loading…
Reference in New Issue
Block a user