mirror of
https://github.com/AuxXxilium/arc.git
synced 2024-11-23 22:09:53 +07:00
arc: add more features for online
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
d876d274d4
commit
d890c54a1b
@ -695,8 +695,10 @@ function backupMenu() {
|
|||||||
while true; do
|
while true; do
|
||||||
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
|
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
|
||||||
1 "Restore Arc Config from DSM" \
|
1 "Restore Arc Config from DSM" \
|
||||||
2 "Restore HW Encryption Key from DSM" \
|
2 "Restore Arc Config online" \
|
||||||
3 "Backup HW Encryption Key to DSM" \
|
3 "Backup Arc Config online" \
|
||||||
|
4 "Restore HW Encryption Key from DSM" \
|
||||||
|
5 "Backup HW Encryption Key to DSM" \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && break
|
[ $? -ne 0 ] && break
|
||||||
case "$(cat ${TMP_PATH}/resp)" in
|
case "$(cat ${TMP_PATH}/resp)" in
|
||||||
@ -755,6 +757,30 @@ function backupMenu() {
|
|||||||
exec init.sh
|
exec init.sh
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
|
[ -f "${USER_CONFIG_FILE}" ] && mv -f "${USER_CONFIG_FILE}" "${USER_CONFIG_FILE}.bak"
|
||||||
|
HWID="$(genHWID)"
|
||||||
|
USERID="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
|
||||||
|
if curl -skL "https://arc.auxxxilium.tech?cdown=${HWID}" -o "${USER_CONFIG_FILE}" 2>/dev/null; then
|
||||||
|
dialog --backtitle "$(backtitle)" --title "Online Restore" --msgbox "Online Restore successful!" 5 40
|
||||||
|
else
|
||||||
|
dialog --backtitle "$(backtitle)" --title "Online Restore" --msgbox "Online Restore failed!" 5 40
|
||||||
|
mv -f "${USER_CONFIG_FILE}.bak" "${USER_CONFIG_FILE}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
if [ -f "${USER_CONFIG_FILE}" ]; then
|
||||||
|
HWID="$(genHWID)"
|
||||||
|
USERID="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
|
||||||
|
if curl -sk -X POST -F "file=@${USER_CONFIG_FILE}" "https://arc.auxxxilium.tech?cup=${HWID}&userid=${USERID}"; then
|
||||||
|
dialog --backtitle "$(backtitle)" --title "Online Backup" --msgbox "Online Backup successful!" 5 40
|
||||||
|
else
|
||||||
|
dialog --backtitle "$(backtitle)" --title "Online Backup" --msgbox "Online Backup failed!" 5 40
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
dialog --backtitle "$(backtitle)" --title "Online Backup" --msgbox "No User Config found!" 5 40
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
4)
|
||||||
DSMROOTS="$(findDSMRoot)"
|
DSMROOTS="$(findDSMRoot)"
|
||||||
if [ -z "${DSMROOTS}" ]; then
|
if [ -z "${DSMROOTS}" ]; then
|
||||||
dialog --backtitle "$(backtitle)" --title "Restore Encryption Key" \
|
dialog --backtitle "$(backtitle)" --title "Restore Encryption Key" \
|
||||||
@ -779,7 +805,7 @@ function backupMenu() {
|
|||||||
--msgbox "No Encryption Key found!" 0 0
|
--msgbox "No Encryption Key found!" 0 0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
3)
|
5)
|
||||||
BACKUPKEY="false"
|
BACKUPKEY="false"
|
||||||
DSMROOTS="$(findDSMRoot)"
|
DSMROOTS="$(findDSMRoot)"
|
||||||
if [ -z "${DSMROOTS}" ]; then
|
if [ -z "${DSMROOTS}" ]; then
|
||||||
@ -911,7 +937,6 @@ function sysinfo() {
|
|||||||
# Get System Informations
|
# Get System Informations
|
||||||
[ -d /sys/firmware/efi ] && BOOTSYS="UEFI" || BOOTSYS="BIOS"
|
[ -d /sys/firmware/efi ] && BOOTSYS="UEFI" || BOOTSYS="BIOS"
|
||||||
CPU="$(cat /proc/cpuinfo 2>/dev/null | grep 'model name' | uniq | awk -F':' '{print $2}')"
|
CPU="$(cat /proc/cpuinfo 2>/dev/null | grep 'model name' | uniq | awk -F':' '{print $2}')"
|
||||||
HWID="$(genHWID)"
|
|
||||||
SECURE=$(dmesg 2>/dev/null | grep -i "Secure Boot" | awk -F'] ' '{print $2}')
|
SECURE=$(dmesg 2>/dev/null | grep -i "Secure Boot" | awk -F'] ' '{print $2}')
|
||||||
VENDOR=$(dmesg 2>/dev/null | grep -i "DMI:" | head -1 | sed 's/\[.*\] DMI: //i')
|
VENDOR=$(dmesg 2>/dev/null | grep -i "DMI:" | head -1 | sed 's/\[.*\] DMI: //i')
|
||||||
ETHX="$(ls /sys/class/net 2>/dev/null | grep eth)"
|
ETHX="$(ls /sys/class/net 2>/dev/null | grep eth)"
|
||||||
@ -960,7 +985,6 @@ function sysinfo() {
|
|||||||
TEXT=""
|
TEXT=""
|
||||||
# Print System Informations
|
# Print System Informations
|
||||||
TEXT+="\n\n\Z4> System: ${MACHINE} | ${BOOTSYS} | ${BUS}\Zn"
|
TEXT+="\n\n\Z4> System: ${MACHINE} | ${BOOTSYS} | ${BUS}\Zn"
|
||||||
TEXT+="\n HardwareID: \Zb${HWID}\Zn"
|
|
||||||
TEXT+="\n Vendor: \Zb${VENDOR}\Zn"
|
TEXT+="\n Vendor: \Zb${VENDOR}\Zn"
|
||||||
TEXT+="\n CPU: \Zb${CPU}\Zn"
|
TEXT+="\n CPU: \Zb${CPU}\Zn"
|
||||||
if [ $(lspci -d ::300 | wc -l) -gt 0 ]; then
|
if [ $(lspci -d ::300 | wc -l) -gt 0 ]; then
|
||||||
@ -1137,7 +1161,7 @@ function sysinfo() {
|
|||||||
fi
|
fi
|
||||||
TEXT+="\n Total Disks: \Zb${NUMPORTS}\Zn"
|
TEXT+="\n Total Disks: \Zb${NUMPORTS}\Zn"
|
||||||
[ -f "${TMP_PATH}/diag" ] && rm -f "${TMP_PATH}/diag" >/dev/null
|
[ -f "${TMP_PATH}/diag" ] && rm -f "${TMP_PATH}/diag" >/dev/null
|
||||||
echo -e "${TEXT}" >"${TMP_PATH}/diag"
|
echo -e "${TEXT}" >"${TMP_PATH}/sysinfo.yml"
|
||||||
while true; do
|
while true; do
|
||||||
dialog --backtitle "$(backtitle)" --colors --ok-label "Exit" --help-button --help-label "Show Cmdline" \
|
dialog --backtitle "$(backtitle)" --colors --ok-label "Exit" --help-button --help-label "Show Cmdline" \
|
||||||
--extra-button --extra-label "Upload" --title "Sysinfo" --msgbox "${TEXT}" 0 0
|
--extra-button --extra-label "Upload" --title "Sysinfo" --msgbox "${TEXT}" 0 0
|
||||||
@ -1173,9 +1197,14 @@ function getCMDline () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function uploadDiag () {
|
function uploadDiag () {
|
||||||
if [ -f "${TMP_PATH}/diag" ]; then
|
if [ -f "${TMP_PATH}/sysinfo.yml" ]; then
|
||||||
GENHASH=$(cat "${TMP_PATH}/diag" | curl -s -F "content=<-" "http://arc.auxxxilium.tech?sysinfo=${HWID}")
|
HWID="$(genHWID)"
|
||||||
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "Your Code: ${HWID}" 5 30
|
USERID="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
|
||||||
|
if curl -sk -X POST -F "file=@${TMP_PATH}/sysinfo.yml" "https://arc.auxxxilium.tech?sysinfo=${HWID}&userid=${USERID}"; then
|
||||||
|
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "Your Code: ${HWID}" 5 40
|
||||||
|
else
|
||||||
|
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "Failed to upload diag file!" 0 0
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "No Diag File found!" 0 0
|
dialog --backtitle "$(backtitle)" --title "Sysinfo Upload" --msgbox "No Diag File found!" 0 0
|
||||||
fi
|
fi
|
||||||
|
@ -698,7 +698,17 @@ function make() {
|
|||||||
# Max Memory for DSM
|
# Max Memory for DSM
|
||||||
RAMCONFIG="$((${RAMTOTAL} * 1024 * 2))"
|
RAMCONFIG="$((${RAMTOTAL} * 1024 * 2))"
|
||||||
writeConfigKey "synoinfo.mem_max_mb" "${RAMCONFIG}" "${USER_CONFIG_FILE}"
|
writeConfigKey "synoinfo.mem_max_mb" "${RAMCONFIG}" "${USER_CONFIG_FILE}"
|
||||||
getpatfiles
|
if [ -n "${IPCON}" ]; then
|
||||||
|
getpatfiles
|
||||||
|
else
|
||||||
|
dialog --backtitle "$(backtitle)" --title "Build Loader" --aspect 18 \
|
||||||
|
--infobox "Could not build Loader!\nNetwork Connection needed." 4 40
|
||||||
|
# Set Build to false
|
||||||
|
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
|
||||||
|
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
|
||||||
|
sleep 2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
if [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ] && [ "${CONFDONE}" == "true" ] && [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then
|
if [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ] && [ "${CONFDONE}" == "true" ] && [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then
|
||||||
(
|
(
|
||||||
livepatch
|
livepatch
|
||||||
@ -829,7 +839,7 @@ else
|
|||||||
echo "0 \"HardwareID for Arc Patch\" " >>"${TMP_PATH}/menu"
|
echo "0 \"HardwareID for Arc Patch\" " >>"${TMP_PATH}/menu"
|
||||||
fi
|
fi
|
||||||
echo "1 \"Choose Model \" " >>"${TMP_PATH}/menu"
|
echo "1 \"Choose Model \" " >>"${TMP_PATH}/menu"
|
||||||
if [ "${CONFDONE}" == "true" ]; then
|
if [ "${CONFDONE}" == "true" ] && [ -n "${IPCON}" ]; then
|
||||||
echo "2 \"Build Loader \" " >>"${TMP_PATH}/menu"
|
echo "2 \"Build Loader \" " >>"${TMP_PATH}/menu"
|
||||||
fi
|
fi
|
||||||
if [ "${BUILDDONE}" == "true" ]; then
|
if [ "${BUILDDONE}" == "true" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user