tree: update

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium
2025-01-20 18:45:07 +01:00
parent 9985b68556
commit fbc5ce8073
3 changed files with 10 additions and 49 deletions

View File

@@ -697,23 +697,20 @@ function backupMenu() {
if [ -n "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ] && [ "${CONFDONE}" = "true" ]; then
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
1 "Restore Arc Config from DSM" \
2 "Restore HW Encryption Key from DSM" \
3 "Backup HW Encryption Key to DSM" \
4 "Restore Arc Config from Online" \
5 "Backup Arc Config to Online" \
2 "Restore Hardware Key from DSM" \
3 "Restore Arc Config from Online" \
4 "Backup Arc Config to Online" \
2>"${TMP_PATH}/resp"
elif [ -n "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ]; then
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
1 "Restore Arc Config from DSM" \
2 "Restore HW Encryption Key from DSM" \
3 "Backup HW Encryption Key to DSM" \
4 "Restore Arc Config from Online" \
2 "Restore Hardware Key from DSM" \
3 "Restore Arc Config from Online" \
2>"${TMP_PATH}/resp"
else
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
1 "Restore Arc Config from DSM" \
2 "Restore HW Encryption Key from DSM" \
3 "Backup HW Encryption Key to DSM" \
2 "Restore Hardware Key from DSM" \
2>"${TMP_PATH}/resp"
fi
[ $? -ne 0 ] && break
@@ -800,43 +797,6 @@ function backupMenu() {
fi
;;
3)
BACKUPKEY="false"
DSMROOTS="$(findDSMRoot)"
if [ -z "${DSMROOTS}" ]; then
dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \
--msgbox "No DSM system partition(md0) found!\nPlease insert all disks before continuing." 0 0
return
fi
(
mkdir -p "${TMP_PATH}/mdX"
for I in ${DSMROOTS}; do
while true; do
# fixDSMRootPart "${I}"
mount -t ext4 "${I}" "${TMP_PATH}/mdX"
if [ -f "${PART2_PATH}/machine.key" ]; then
mkdir -p "${TMP_PATH}/mdX/usr/arc/backup/p2"
cp -f "${PART2_PATH}/machine.key" "${TMP_PATH}/mdX/usr/arc/backup/p2/machine.key"
if [ -f "${TMP_PATH}/mdX/usr/arc/backup/p2/machine.key" ]; then
BACKUPKEY="true"
sync
break
fi
fi
umount "${TMP_PATH}/mdX"
done
done
rm -rf "${TMP_PATH}/mdX" >/dev/null
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \
--progressbox "Backup Encryption Key ..." 20 70
if [ "${BACKUPKEY}" = "true" ]; then
dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \
--msgbox "Encryption Key backup successful!" 0 0
else
dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \
--msgbox "No Encryption Key found!" 0 0
fi
;;
4)
[ -f "${USER_CONFIG_FILE}" ] && mv -f "${USER_CONFIG_FILE}" "${USER_CONFIG_FILE}.bak"
HWID="$(genHWID)"
if curl -skL "https://arc.auxxxilium.tech?cdown=${HWID}" -o "${USER_CONFIG_FILE}" 2>/dev/null; then
@@ -867,7 +827,7 @@ function backupMenu() {
sleep 2
rm -f "${HOME}/.initialized" && exec init.sh
;;
5)
4)
HWID="$(genHWID)"
curl -sk -X POST -F "file=@${USER_CONFIG_FILE}" "https://arc.auxxxilium.tech?cup=${HWID}&userid=${USERID}" 2>/dev/null
if [ $? -eq 0 ]; then
@@ -1036,7 +996,7 @@ function sysinfo() {
PATCHESVERSION="$(cat "${PATCH_PATH}/VERSION")"
TIMEOUT=5
# Print System Informations
TEXT="\n\n\Z4> System: ${MACHINE} | ${BOOTSYS} | ${BUS}\Zn"
TEXT="\n\Z4> System: ${MACHINE} | ${BOOTSYS} | ${BUS}\Zn"
TEXT+="\n Vendor: \Zb${VENDOR}\Zn"
TEXT+="\n CPU: \Zb${CPU}\Zn"
if [ $(lspci -d ::300 | wc -l) -gt 0 ]; then

View File

@@ -17,6 +17,7 @@ GRUB_PATH="${PART1_PATH}/boot/grub"
USER_GRUB_CONFIG="${GRUB_PATH}/grub.cfg"
USER_GRUBENVFILE="${GRUB_PATH}/grubenv"
USER_CONFIG_FILE="${PART1_PATH}/user-config.yml"
HW_KEY="${PART2_PATH}/machine.key"
ORI_ZIMAGE_FILE="${PART2_PATH}/zImage"
ORI_RDGZ_FILE="${PART2_PATH}/rd.gz"

View File

@@ -203,7 +203,7 @@ fi
# backup current loader configs
BACKUP_PATH="${RAMDISK_PATH}/usr/arc/backup"
rm -rf "${BACKUP_PATH}"
for F in "${USER_GRUB_CONFIG}" "${USER_CONFIG_FILE}" "${USER_UP_PATH}"; do
for F in "${USER_GRUB_CONFIG}" "${USER_CONFIG_FILE}" "${USER_UP_PATH}" "${HW_KEY}"; do
if [ -f "${F}" ]; then
FD="$(dirname "${F}")"
mkdir -p "${FD/\/mnt/${BACKUP_PATH}}"