mirror of
https://github.com/AuxXxilium/arc-c.git
synced 2024-11-23 23:11:08 +07:00
arc-c: sync with arc
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
8d346f7dea
commit
d4dd0eab3b
15
.github/workflows/issues.yml
vendored
15
.github/workflows/issues.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Check Issues
|
- name: Check Issues
|
||||||
run: |
|
run: |
|
||||||
if echo "${{ github.event.issue.body }}" | grep -q "Screenshots"; then
|
if echo "${{ github.event.issue.body }}" | grep -q "Hardware"; then
|
||||||
echo "FALG=true" >> $GITHUB_ENV
|
echo "FALG=true" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
echo "FALG=false" >> $GITHUB_ENV
|
echo "FALG=false" >> $GITHUB_ENV
|
||||||
@ -38,9 +38,14 @@ jobs:
|
|||||||
body: |
|
body: |
|
||||||
**Describe the Bug**
|
**Describe the Bug**
|
||||||
A clear and concise description of what the bug is.
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
Screenshot the Systeminfo (Arc - Sysinfo) or use new "Full Sysinfo - Upload" Function provide the Code!!! <- IMPORTANT
|
|
||||||
|
|
||||||
**Hardware**
|
**Hardware**
|
||||||
Add your Hardware Informations here. CPU / Board / Networkcontroller / Storagecontroller / ...
|
Add your Hardware Informations here. CPU / Board / Networkcontroller / Storagecontroller / ...
|
||||||
|
|
||||||
|
- name: Close Issues
|
||||||
|
if: env.FALG == 'false'
|
||||||
|
uses: actions-cool/issues-helper@v3
|
||||||
|
with:
|
||||||
|
actions: 'close-issue'
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
issue-number: ${{ github.event.issue.number }}
|
@ -60,7 +60,7 @@ function addonSelection() {
|
|||||||
--checklist "Select Loader Addons to include.\nPlease read Wiki before choosing anything.\nSelect with SPACE, Confirm with ENTER!" 0 0 0 \
|
--checklist "Select Loader Addons to include.\nPlease read Wiki before choosing anything.\nSelect with SPACE, Confirm with ENTER!" 0 0 0 \
|
||||||
--file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp"
|
--file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && return 1
|
[ $? -ne 0 ] && return 1
|
||||||
resp="$(<"${TMP_PATH}/resp")"
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
unset ADDONS
|
unset ADDONS
|
||||||
declare -A ADDONS
|
declare -A ADDONS
|
||||||
writeConfigKey "addons" "{}" "${USER_CONFIG_FILE}"
|
writeConfigKey "addons" "{}" "${USER_CONFIG_FILE}"
|
||||||
@ -101,7 +101,7 @@ function modulesMenu() {
|
|||||||
6 "Add external module" \
|
6 "Add external module" \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && break
|
[ $? -ne 0 ] && break
|
||||||
case "$(<"${TMP_PATH}/resp")" in
|
case "$(cat ${TMP_PATH}/resp)" in
|
||||||
1)
|
1)
|
||||||
ITEMS=""
|
ITEMS=""
|
||||||
for KEY in ${!USERMODULES[@]}; do
|
for KEY in ${!USERMODULES[@]}; do
|
||||||
@ -159,8 +159,8 @@ function modulesMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" --title "Modules" --aspect 18 \
|
dialog --backtitle "$(backtitle)" --title "Modules" --aspect 18 \
|
||||||
--checklist "Select Modules to include" 0 0 0 \
|
--checklist "Select Modules to include" 0 0 0 \
|
||||||
--file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp"
|
--file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && return 1
|
||||||
resp="$(<"${TMP_PATH}/resp")"
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
dialog --backtitle "$(backtitle)" --title "Modules" \
|
dialog --backtitle "$(backtitle)" --title "Modules" \
|
||||||
--infobox "Writing to user config" 20 5
|
--infobox "Writing to user config" 20 5
|
||||||
unset USERMODULES
|
unset USERMODULES
|
||||||
@ -182,18 +182,18 @@ function modulesMenu() {
|
|||||||
TEXT+="Do you want to continue?"
|
TEXT+="Do you want to continue?"
|
||||||
dialog --backtitle "$(backtitle)" --title "Add external Module" \
|
dialog --backtitle "$(backtitle)" --title "Add external Module" \
|
||||||
--yesno "${TEXT}" 0 0
|
--yesno "${TEXT}" 0 0
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && return 1
|
||||||
dialog --backtitle "$(backtitle)" --aspect 18 --colors --inputbox "Please enter the complete URL to download.\n" 0 0 \
|
dialog --backtitle "$(backtitle)" --aspect 18 --colors --inputbox "Please enter the complete URL to download.\n" 0 0 \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
URL="$(<"${TMP_PATH}/resp")"
|
URL=$(cat "${TMP_PATH}/resp")
|
||||||
[ -z "${URL}" ] && continue
|
[ -z "${URL}" ] && return 1
|
||||||
clear
|
clear
|
||||||
echo "Downloading ${URL}"
|
echo "Downloading ${URL}"
|
||||||
STATUS=$(curl -kLJO -w "%{http_code}" "${URL}" --progress-bar)
|
STATUS=$(curl -kLJO -w "%{http_code}" "${URL}" --progress-bar)
|
||||||
if [[ $? -ne 0 || ${STATUS} -ne 200 ]]; then
|
if [[ $? -ne 0 || ${STATUS} -ne 200 ]]; then
|
||||||
dialog --backtitle "$(backtitle)" --title "Add external Module" --aspect 18 \
|
dialog --backtitle "$(backtitle)" --title "Add external Module" --aspect 18 \
|
||||||
--msgbox "ERROR: Check internet, URL or cache disk space" 0 0
|
--msgbox "ERROR: Check internet, URL or cache disk space" 0 0
|
||||||
continue
|
return 1
|
||||||
fi
|
fi
|
||||||
KONAME=$(basename "$URL")
|
KONAME=$(basename "$URL")
|
||||||
if [[ -n "${KONAME}" && "${KONAME##*.}" = "ko" ]]; then
|
if [[ -n "${KONAME}" && "${KONAME##*.}" = "ko" ]]; then
|
||||||
@ -234,7 +234,7 @@ function cmdlineMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" --menu "Choose an Option" 0 0 0 \
|
dialog --backtitle "$(backtitle)" --menu "Choose an Option" 0 0 0 \
|
||||||
--file "${TMP_PATH}/menu" 2>"${TMP_PATH}/resp"
|
--file "${TMP_PATH}/menu" 2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && return 1
|
[ $? -ne 0 ] && return 1
|
||||||
case "$(<"${TMP_PATH}/resp")" in
|
case "$(cat ${TMP_PATH}/resp)" in
|
||||||
1)
|
1)
|
||||||
MSG=""
|
MSG=""
|
||||||
MSG+="Commonly used Parameter:\n"
|
MSG+="Commonly used Parameter:\n"
|
||||||
@ -285,9 +285,9 @@ function cmdlineMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" \
|
dialog --backtitle "$(backtitle)" \
|
||||||
--checklist "Select cmdline to remove" 0 0 0 ${ITEMS} \
|
--checklist "Select cmdline to remove" 0 0 0 ${ITEMS} \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && return 1
|
||||||
resp="$(<"${TMP_PATH}/resp")"
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
[ -z "${resp}" ] && continue
|
[ -z "${resp}" ] && return 1
|
||||||
for I in ${resp}; do
|
for I in ${resp}; do
|
||||||
unset 'CMDLINE[${I}]'
|
unset 'CMDLINE[${I}]'
|
||||||
deleteConfigKey "cmdline.\"${I}\"" "${USER_CONFIG_FILE}"
|
deleteConfigKey "cmdline.\"${I}\"" "${USER_CONFIG_FILE}"
|
||||||
@ -301,7 +301,7 @@ function cmdlineMenu() {
|
|||||||
1 "Install" \
|
1 "Install" \
|
||||||
2 "Uninnstall" \
|
2 "Uninnstall" \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
resp="$(<"${TMP_PATH}/resp")"
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
[ -z "${resp}" ] && return 1
|
[ -z "${resp}" ] && return 1
|
||||||
if [ ${resp} -eq 1 ]; then
|
if [ ${resp} -eq 1 ]; then
|
||||||
writeConfigKey "cmdline.nmi_watchdog" "0" "${USER_CONFIG_FILE}"
|
writeConfigKey "cmdline.nmi_watchdog" "0" "${USER_CONFIG_FILE}"
|
||||||
@ -323,7 +323,7 @@ function cmdlineMenu() {
|
|||||||
1 "Install" \
|
1 "Install" \
|
||||||
2 "Uninnstall" \
|
2 "Uninnstall" \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
resp="$(<"${TMP_PATH}/resp")"
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
[ -z "${resp}" ] && return 1
|
[ -z "${resp}" ] && return 1
|
||||||
if [ ${resp} -eq 1 ]; then
|
if [ ${resp} -eq 1 ]; then
|
||||||
writeConfigKey "cmdline.disable_mtrr_trim" "0" "${USER_CONFIG_FILE}"
|
writeConfigKey "cmdline.disable_mtrr_trim" "0" "${USER_CONFIG_FILE}"
|
||||||
@ -345,7 +345,7 @@ function cmdlineMenu() {
|
|||||||
1 "Install" \
|
1 "Install" \
|
||||||
2 "Uninnstall" \
|
2 "Uninnstall" \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
resp="$(<"${TMP_PATH}/resp")"
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
[ -z "${resp}" ] && return 1
|
[ -z "${resp}" ] && return 1
|
||||||
if [ ${resp} -eq 1 ]; then
|
if [ ${resp} -eq 1 ]; then
|
||||||
writeConfigKey "cmdline.pci" "routeirq" "${USER_CONFIG_FILE}"
|
writeConfigKey "cmdline.pci" "routeirq" "${USER_CONFIG_FILE}"
|
||||||
@ -365,7 +365,7 @@ function cmdlineMenu() {
|
|||||||
1 "Install" \
|
1 "Install" \
|
||||||
2 "Uninnstall" \
|
2 "Uninnstall" \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
resp="$(<"${TMP_PATH}/resp")"
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
[ -z "${resp}" ] && return 1
|
[ -z "${resp}" ] && return 1
|
||||||
if [ ${resp} -eq 1 ]; then
|
if [ ${resp} -eq 1 ]; then
|
||||||
writeConfigKey "cmdline.intel_idle.max_cstate" "1" "${USER_CONFIG_FILE}"
|
writeConfigKey "cmdline.intel_idle.max_cstate" "1" "${USER_CONFIG_FILE}"
|
||||||
@ -403,9 +403,9 @@ function cmdlineMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" --colors --title "Kernelpanic" \
|
dialog --backtitle "$(backtitle)" --colors --title "Kernelpanic" \
|
||||||
--default-item "${KERNELPANIC}" --menu "Choose a time(seconds)" 0 0 0 --file "${TMP_PATH}/opts" \
|
--default-item "${KERNELPANIC}" --menu "Choose a time(seconds)" 0 0 0 --file "${TMP_PATH}/opts" \
|
||||||
2>${TMP_PATH}/resp
|
2>${TMP_PATH}/resp
|
||||||
[ $? -ne 0 ] && return
|
[ $? -ne 0 ] && return 1
|
||||||
resp=$(cat ${TMP_PATH}/resp 2>/dev/null)
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
[ -z "${resp}" ] && return
|
[ -z "${resp}" ] && return 1
|
||||||
KERNELPANIC=${resp}
|
KERNELPANIC=${resp}
|
||||||
writeConfigKey "arc.kernelpanic" "${KERNELPANIC}" "${USER_CONFIG_FILE}"
|
writeConfigKey "arc.kernelpanic" "${KERNELPANIC}" "${USER_CONFIG_FILE}"
|
||||||
;;
|
;;
|
||||||
@ -434,19 +434,19 @@ function synoinfoMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" --menu "Choose an Option" 0 0 0 \
|
dialog --backtitle "$(backtitle)" --menu "Choose an Option" 0 0 0 \
|
||||||
--file "${TMP_PATH}/menu" 2>"${TMP_PATH}/resp"
|
--file "${TMP_PATH}/menu" 2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && return 1
|
[ $? -ne 0 ] && return 1
|
||||||
case "$(<"${TMP_PATH}/resp")" in
|
case "$(cat ${TMP_PATH}/resp)" in
|
||||||
1)
|
1)
|
||||||
dialog --backtitle "$(backtitle)" --title "Synoinfo entries" \
|
dialog --backtitle "$(backtitle)" --title "Synoinfo entries" \
|
||||||
--inputbox "Type a name of synoinfo entry" 0 0 \
|
--inputbox "Type a name of synoinfo entry" 0 0 \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && return 1
|
||||||
NAME="$(<"${TMP_PATH}/resp")"
|
NAME=$(cat "${TMP_PATH}/resp")
|
||||||
[ -z "${NAME//\"/}" ] && continue
|
[ -z "${NAME//\"/}" ] && return 1
|
||||||
dialog --backtitle "$(backtitle)" --title "Synoinfo entries" \
|
dialog --backtitle "$(backtitle)" --title "Synoinfo entries" \
|
||||||
--inputbox "Type a value of '${NAME}' entry" 0 0 "${SYNOINFO[${NAME}]}" \
|
--inputbox "Type a value of '${NAME}' entry" 0 0 "${SYNOINFO[${NAME}]}" \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && return 1
|
||||||
VALUE="$(<"${TMP_PATH}/resp")"
|
VALUE=$(cat "${TMP_PATH}/resp")
|
||||||
SYNOINFO[${NAME}]="${VALUE}"
|
SYNOINFO[${NAME}]="${VALUE}"
|
||||||
writeConfigKey "synoinfo.\"${NAME//\"/}\"" "${VALUE}" "${USER_CONFIG_FILE}"
|
writeConfigKey "synoinfo.\"${NAME//\"/}\"" "${VALUE}" "${USER_CONFIG_FILE}"
|
||||||
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
|
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
|
||||||
@ -464,9 +464,9 @@ function synoinfoMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" \
|
dialog --backtitle "$(backtitle)" \
|
||||||
--checklist "Select synoinfo entry to remove" 0 0 0 ${ITEMS} \
|
--checklist "Select synoinfo entry to remove" 0 0 0 ${ITEMS} \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && return 1
|
||||||
resp="$(<"${TMP_PATH}/resp")"
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
[ -z "${resp}" ] && continue
|
[ -z "${resp}" ] && return 1
|
||||||
for I in ${resp}; do
|
for I in ${resp}; do
|
||||||
unset 'SYNOINFO[${I}]'
|
unset 'SYNOINFO[${I}]'
|
||||||
deleteConfigKey "synoinfo.\"${I}\"" "${USER_CONFIG_FILE}"
|
deleteConfigKey "synoinfo.\"${I}\"" "${USER_CONFIG_FILE}"
|
||||||
@ -509,7 +509,7 @@ function synoinfoMenu() {
|
|||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
RET=$?
|
RET=$?
|
||||||
[ ${RET} -ne 0 ] && break 2
|
[ ${RET} -ne 0 ] && break 2
|
||||||
CPUTEMP="$(<"${TMP_PATH}/resp")"
|
CPUTEMP=$(cat "${TMP_PATH}/resp")
|
||||||
if [ "${PLATFORM}" = "geminilake" ]; then
|
if [ "${PLATFORM}" = "geminilake" ]; then
|
||||||
sed -i 's|<cpu_temperature fan_speed="99%40hz" action="SHUTDOWN">90</cpu_temperature>|<cpu_temperature fan_speed="99%40hz" action="SHUTDOWN">'"${CPUTEMP}"'</cpu_temperature>|g' "${DSMROOT_PATH}/usr/syno/etc.defaults/scemd.xml"
|
sed -i 's|<cpu_temperature fan_speed="99%40hz" action="SHUTDOWN">90</cpu_temperature>|<cpu_temperature fan_speed="99%40hz" action="SHUTDOWN">'"${CPUTEMP}"'</cpu_temperature>|g' "${DSMROOT_PATH}/usr/syno/etc.defaults/scemd.xml"
|
||||||
elif [[ "${PLATFORM}" = "r1000" || "${PLATFORM}" = "v1000" || "${PLATFORM}" = "epyc7002" ]]; then
|
elif [[ "${PLATFORM}" = "r1000" || "${PLATFORM}" = "v1000" || "${PLATFORM}" = "epyc7002" ]]; then
|
||||||
@ -520,7 +520,7 @@ function synoinfoMenu() {
|
|||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
RET=$?
|
RET=$?
|
||||||
[ ${RET} -ne 0 ] && break 2
|
[ ${RET} -ne 0 ] && break 2
|
||||||
DISKTEMP="$(<"${TMP_PATH}/resp")"
|
DISKTEMP=$(cat "${TMP_PATH}/resp")
|
||||||
if [ "${PLATFORM}" = "geminilake" ]; then
|
if [ "${PLATFORM}" = "geminilake" ]; then
|
||||||
sed -i 's|<disk_temperature fan_speed="99%40hz" action="SHUTDOWN">61</disk_temperature>|<disk_temperature fan_speed="99%40hz" action="SHUTDOWN">'"${DISKTEMP}"'</disk_temperature>|g' "/mnt/dsmroot/usr/syno/etc.defaults/scemd.xml"
|
sed -i 's|<disk_temperature fan_speed="99%40hz" action="SHUTDOWN">61</disk_temperature>|<disk_temperature fan_speed="99%40hz" action="SHUTDOWN">'"${DISKTEMP}"'</disk_temperature>|g' "/mnt/dsmroot/usr/syno/etc.defaults/scemd.xml"
|
||||||
elif [[ "${PLATFORM}" = "r1000" || "${PLATFORM}" = "v1000" || "${PLATFORM}" = "epyc7002" ]]; then
|
elif [[ "${PLATFORM}" = "r1000" || "${PLATFORM}" = "v1000" || "${PLATFORM}" = "epyc7002" ]]; then
|
||||||
@ -531,7 +531,7 @@ function synoinfoMenu() {
|
|||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
RET=$?
|
RET=$?
|
||||||
[ ${RET} -ne 0 ] && break 2
|
[ ${RET} -ne 0 ] && break 2
|
||||||
M2TEMP="$(<"${TMP_PATH}/resp")"
|
M2TEMP=$(cat "${TMP_PATH}/resp")
|
||||||
if [ "${PLATFORM}" = "geminilake" ]; then
|
if [ "${PLATFORM}" = "geminilake" ]; then
|
||||||
sed -i 's|<m2_temperature fan_speed="99%40hz" action="SHUTDOWN">70</m2_temperature>|<m2_temperature fan_speed="99%40hz" action="SHUTDOWN">'"${M2TEMP}"'</m2_temperature>|g' "${DSMROOT_PATH}/usr/syno/etc.defaults/scemd.xml"
|
sed -i 's|<m2_temperature fan_speed="99%40hz" action="SHUTDOWN">70</m2_temperature>|<m2_temperature fan_speed="99%40hz" action="SHUTDOWN">'"${M2TEMP}"'</m2_temperature>|g' "${DSMROOT_PATH}/usr/syno/etc.defaults/scemd.xml"
|
||||||
elif [[ "${PLATFORM}" = "r1000" || "${PLATFORM}" = "v1000" || "${PLATFORM}" = "epyc7002" ]]; then
|
elif [[ "${PLATFORM}" = "r1000" || "${PLATFORM}" = "v1000" || "${PLATFORM}" = "epyc7002" ]]; then
|
||||||
@ -564,7 +564,7 @@ function keymapMenu() {
|
|||||||
"dvorak" "fgGIod" "neo" "olpc" "qwerty" "qwertz" \
|
"dvorak" "fgGIod" "neo" "olpc" "qwerty" "qwertz" \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && return 1
|
[ $? -ne 0 ] && return 1
|
||||||
LAYOUT="$(<"${TMP_PATH}/resp")"
|
LAYOUT=$(cat "${TMP_PATH}/resp")
|
||||||
OPTIONS=""
|
OPTIONS=""
|
||||||
while read -r KM; do
|
while read -r KM; do
|
||||||
OPTIONS+="${KM::-7} "
|
OPTIONS+="${KM::-7} "
|
||||||
@ -572,9 +572,9 @@ function keymapMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" --no-items --default-item "${KEYMAP}" \
|
dialog --backtitle "$(backtitle)" --no-items --default-item "${KEYMAP}" \
|
||||||
--menu "Choice a keymap" 0 0 0 ${OPTIONS} \
|
--menu "Choice a keymap" 0 0 0 ${OPTIONS} \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && return 1
|
||||||
resp="$(<"${TMP_PATH}/resp")"
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
[ -z "${resp}" ] && continue
|
[ -z "${resp}" ] && return 1
|
||||||
KEYMAP=${resp}
|
KEYMAP=${resp}
|
||||||
writeConfigKey "layout" "${LAYOUT}" "${USER_CONFIG_FILE}"
|
writeConfigKey "layout" "${LAYOUT}" "${USER_CONFIG_FILE}"
|
||||||
writeConfigKey "keymap" "${KEYMAP}" "${USER_CONFIG_FILE}"
|
writeConfigKey "keymap" "${KEYMAP}" "${USER_CONFIG_FILE}"
|
||||||
@ -592,14 +592,14 @@ function storagepanelMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" --title "StoragePanel" \
|
dialog --backtitle "$(backtitle)" --title "StoragePanel" \
|
||||||
--default-item "24_Bay" --no-items --menu "Choose a Disk Panel" 0 0 0 ${ITEMS} \
|
--default-item "24_Bay" --no-items --menu "Choose a Disk Panel" 0 0 0 ${ITEMS} \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
resp="$(cat ${TMP_PATH}/resp 2>/dev/null)"
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
[ -z "${resp}" ] && return 1
|
[ -z "${resp}" ] && return 1
|
||||||
STORAGE=${resp}
|
STORAGE=${resp}
|
||||||
ITEMS="$(echo -e "1X2 \n1X4 \n1X8 \n")"
|
ITEMS="$(echo -e "1X2 \n1X4 \n1X8 \n")"
|
||||||
dialog --backtitle "$(backtitle)" --title "StoragePanel" \
|
dialog --backtitle "$(backtitle)" --title "StoragePanel" \
|
||||||
--default-item "1X8" --no-items --menu "Choose a M.2 Panel" 0 0 0 ${ITEMS} \
|
--default-item "1X8" --no-items --menu "Choose a M.2 Panel" 0 0 0 ${ITEMS} \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
resp="$(cat ${TMP_PATH}/resp 2>/dev/null)"
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
[ -z "${resp}" ] && return 1
|
[ -z "${resp}" ] && return 1
|
||||||
M2PANEL=${resp}
|
M2PANEL=${resp}
|
||||||
STORAGEPANEL="RACK_${STORAGE} ${M2PANEL}"
|
STORAGEPANEL="RACK_${STORAGE} ${M2PANEL}"
|
||||||
@ -624,7 +624,7 @@ function backupMenu() {
|
|||||||
5 "Restore Encryption Key" \
|
5 "Restore Encryption Key" \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && return 1
|
[ $? -ne 0 ] && return 1
|
||||||
case "$(<"${TMP_PATH}/resp")" in
|
case "$(cat ${TMP_PATH}/resp)" in
|
||||||
1)
|
1)
|
||||||
dialog --backtitle "$(backtitle)" --title "Backup Config with Code" \
|
dialog --backtitle "$(backtitle)" --title "Backup Config with Code" \
|
||||||
--infobox "Write down your Code for Restore!" 0 0
|
--infobox "Write down your Code for Restore!" 0 0
|
||||||
@ -642,7 +642,7 @@ function backupMenu() {
|
|||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
RET=$?
|
RET=$?
|
||||||
[ ${RET} -ne 0 ] && break 2
|
[ ${RET} -ne 0 ] && break 2
|
||||||
GENHASH="$(<"${TMP_PATH}/resp")"
|
GENHASH=$(cat "${TMP_PATH}/resp")
|
||||||
[ ${#GENHASH} -eq 9 ] && break
|
[ ${#GENHASH} -eq 9 ] && break
|
||||||
dialog --backtitle "$(backtitle)" --title "Restore with Code" --msgbox "Invalid Code" 0 0
|
dialog --backtitle "$(backtitle)" --title "Restore with Code" --msgbox "Invalid Code" 0 0
|
||||||
done
|
done
|
||||||
@ -777,7 +777,7 @@ function backupMenu() {
|
|||||||
2 "Restore Encryption Key" \
|
2 "Restore Encryption Key" \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && return 1
|
[ $? -ne 0 ] && return 1
|
||||||
case "$(<"${TMP_PATH}/resp")" in
|
case "$(cat ${TMP_PATH}/resp)" in
|
||||||
1)
|
1)
|
||||||
dialog --backtitle "$(backtitle)" --title "Try to recover DSM" --aspect 18 \
|
dialog --backtitle "$(backtitle)" --title "Try to recover DSM" --aspect 18 \
|
||||||
--infobox "Trying to recover a DSM installed system" 0 0
|
--infobox "Trying to recover a DSM installed system" 0 0
|
||||||
@ -872,7 +872,7 @@ function updateMenu() {
|
|||||||
6 "Update LKMs" \
|
6 "Update LKMs" \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && return 1
|
[ $? -ne 0 ] && return 1
|
||||||
case "$(<"${TMP_PATH}/resp")" in
|
case "$(cat ${TMP_PATH}/resp)" in
|
||||||
1)
|
1)
|
||||||
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
|
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
|
||||||
--infobox "Checking latest version..." 0 0
|
--infobox "Checking latest version..." 0 0
|
||||||
@ -883,7 +883,7 @@ function updateMenu() {
|
|||||||
1 "Latest" \
|
1 "Latest" \
|
||||||
2 "Select Version" \
|
2 "Select Version" \
|
||||||
2>"${TMP_PATH}/opts"
|
2>"${TMP_PATH}/opts"
|
||||||
opts="$(<"${TMP_PATH}/opts")"
|
opts=$(cat ${TMP_PATH}/opts)
|
||||||
[ -z "${opts}" ] && return 1
|
[ -z "${opts}" ] && return 1
|
||||||
if [ ${opts} -eq 1 ]; then
|
if [ ${opts} -eq 1 ]; then
|
||||||
TAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/arc/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
TAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/arc/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
||||||
@ -896,15 +896,15 @@ function updateMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" \
|
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" \
|
||||||
--inputbox "Type the Version!" 0 0 \
|
--inputbox "Type the Version!" 0 0 \
|
||||||
2>"${TMP_PATH}/input"
|
2>"${TMP_PATH}/input"
|
||||||
TAG="$(<"${TMP_PATH}/input")"
|
TAG=$(cat "${TMP_PATH}/input")
|
||||||
[ -z "${TAG}" ] && continue
|
[ -z "${TAG}" ] && return 1
|
||||||
fi
|
fi
|
||||||
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
|
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
|
||||||
--infobox "Downloading ${TAG}" 0 0
|
--infobox "Downloading ${TAG}" 0 0
|
||||||
if [ "${ACTUALVERSION}" = "${TAG}" ]; then
|
if [ "${ACTUALVERSION}" = "${TAG}" ]; then
|
||||||
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
|
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
|
||||||
--yesno "No new version. Actual version is ${ACTUALVERSION}\nForce update?" 0 0
|
--yesno "No new version. Actual version is ${ACTUALVERSION}\nForce update?" 0 0
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && return 1
|
||||||
fi
|
fi
|
||||||
# Download update file
|
# Download update file
|
||||||
STATUS=$(curl --insecure -w "%{http_code}" -L "https://github.com/AuxXxilium/arc/releases/download/${TAG}/arc-${TAG}.img.zip" -o "${TMP_PATH}/arc-${TAG}.img.zip")
|
STATUS=$(curl --insecure -w "%{http_code}" -L "https://github.com/AuxXxilium/arc/releases/download/${TAG}/arc-${TAG}.img.zip" -o "${TMP_PATH}/arc-${TAG}.img.zip")
|
||||||
@ -937,7 +937,7 @@ function updateMenu() {
|
|||||||
rm -f "${TMP_PATH}/arc.img"
|
rm -f "${TMP_PATH}/arc.img"
|
||||||
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
|
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
|
||||||
--yesno "Arc Upgrade successful. New Version: ${TAG}\nReboot?" 0 0
|
--yesno "Arc Upgrade successful. New Version: ${TAG}\nReboot?" 0 0
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && return 1
|
||||||
exec reboot
|
exec reboot
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
@ -949,7 +949,7 @@ function updateMenu() {
|
|||||||
2 "Select Version" \
|
2 "Select Version" \
|
||||||
2>"${TMP_PATH}/opts"
|
2>"${TMP_PATH}/opts"
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && continue
|
||||||
opts="$(<"${TMP_PATH}/opts")"
|
opts=$(cat ${TMP_PATH}/opts)
|
||||||
[ -z "${opts}" ] && return 1
|
[ -z "${opts}" ] && return 1
|
||||||
if [ ${opts} -eq 1 ]; then
|
if [ ${opts} -eq 1 ]; then
|
||||||
TAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/arc-addons/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
TAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/arc-addons/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
||||||
@ -962,8 +962,8 @@ function updateMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" --title "Update Addons" \
|
dialog --backtitle "$(backtitle)" --title "Update Addons" \
|
||||||
--inputbox "Type the Version!" 0 0 \
|
--inputbox "Type the Version!" 0 0 \
|
||||||
2>"${TMP_PATH}/input"
|
2>"${TMP_PATH}/input"
|
||||||
TAG="$(<"${TMP_PATH}/input")"
|
TAG=$(cat "${TMP_PATH}/input")
|
||||||
[ -z "${TAG}" ] && continue
|
[ -z "${TAG}" ] && return 1
|
||||||
fi
|
fi
|
||||||
dialog --backtitle "$(backtitle)" --title "Update Addons" --aspect 18 \
|
dialog --backtitle "$(backtitle)" --title "Update Addons" --aspect 18 \
|
||||||
--infobox "Downloading ${TAG}" 0 0
|
--infobox "Downloading ${TAG}" 0 0
|
||||||
@ -1000,7 +1000,7 @@ function updateMenu() {
|
|||||||
1 "Latest" \
|
1 "Latest" \
|
||||||
2 "Select Version" \
|
2 "Select Version" \
|
||||||
2>"${TMP_PATH}/opts"
|
2>"${TMP_PATH}/opts"
|
||||||
opts="$(<"${TMP_PATH}/opts")"
|
opts=$(cat ${TMP_PATH}/opts)
|
||||||
[ -z "${opts}" ] && return 1
|
[ -z "${opts}" ] && return 1
|
||||||
if [ ${opts} -eq 1 ]; then
|
if [ ${opts} -eq 1 ]; then
|
||||||
TAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/arc-patches/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
TAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/arc-patches/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
||||||
@ -1013,8 +1013,8 @@ function updateMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" --title "Update Patches" \
|
dialog --backtitle "$(backtitle)" --title "Update Patches" \
|
||||||
--inputbox "Type the Version!" 0 0 \
|
--inputbox "Type the Version!" 0 0 \
|
||||||
2>"${TMP_PATH}/input"
|
2>"${TMP_PATH}/input"
|
||||||
TAG="$(<"${TMP_PATH}/input")"
|
TAG=$(cat "${TMP_PATH}/input")
|
||||||
[ -z "${TAG}" ] && continue
|
[ -z "${TAG}" ] && return 1
|
||||||
fi
|
fi
|
||||||
dialog --backtitle "$(backtitle)" --title "Update Patches" --aspect 18 \
|
dialog --backtitle "$(backtitle)" --title "Update Patches" --aspect 18 \
|
||||||
--infobox "Downloading ${TAG}" 0 0
|
--infobox "Downloading ${TAG}" 0 0
|
||||||
@ -1042,7 +1042,7 @@ function updateMenu() {
|
|||||||
1 "Latest" \
|
1 "Latest" \
|
||||||
2 "Select Version" \
|
2 "Select Version" \
|
||||||
2>"${TMP_PATH}/opts"
|
2>"${TMP_PATH}/opts"
|
||||||
opts="$(<"${TMP_PATH}/opts")"
|
opts=$(cat ${TMP_PATH}/opts)
|
||||||
[ -z "${opts}" ] && return 1
|
[ -z "${opts}" ] && return 1
|
||||||
if [ ${opts} -eq 1 ]; then
|
if [ ${opts} -eq 1 ]; then
|
||||||
TAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/arc-modules/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
TAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/arc-modules/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
||||||
@ -1055,8 +1055,8 @@ function updateMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" --title "Update Modules" \
|
dialog --backtitle "$(backtitle)" --title "Update Modules" \
|
||||||
--inputbox "Type the Version!" 0 0 \
|
--inputbox "Type the Version!" 0 0 \
|
||||||
2>"${TMP_PATH}/input"
|
2>"${TMP_PATH}/input"
|
||||||
TAG="$(<"${TMP_PATH}/input")"
|
TAG=$(cat "${TMP_PATH}/input")
|
||||||
[ -z "${TAG}" ] && continue
|
[ -z "${TAG}" ] && return 1
|
||||||
fi
|
fi
|
||||||
dialog --backtitle "$(backtitle)" --title "Update Modules" --aspect 18 \
|
dialog --backtitle "$(backtitle)" --title "Update Modules" --aspect 18 \
|
||||||
--infobox "Downloading ${TAG}" 0 0
|
--infobox "Downloading ${TAG}" 0 0
|
||||||
@ -1098,7 +1098,7 @@ function updateMenu() {
|
|||||||
1 "Latest" \
|
1 "Latest" \
|
||||||
2 "Select Version" \
|
2 "Select Version" \
|
||||||
2>"${TMP_PATH}/opts"
|
2>"${TMP_PATH}/opts"
|
||||||
opts="$(<"${TMP_PATH}/opts")"
|
opts=$(cat ${TMP_PATH}/opts)
|
||||||
[ -z "${opts}" ] && return 1
|
[ -z "${opts}" ] && return 1
|
||||||
if [ ${opts} -eq 1 ]; then
|
if [ ${opts} -eq 1 ]; then
|
||||||
TAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/arc-configs/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
TAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/arc-configs/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
||||||
@ -1111,8 +1111,8 @@ function updateMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" --title "Update Configs" \
|
dialog --backtitle "$(backtitle)" --title "Update Configs" \
|
||||||
--inputbox "Type the Version!" 0 0 \
|
--inputbox "Type the Version!" 0 0 \
|
||||||
2>"${TMP_PATH}/input"
|
2>"${TMP_PATH}/input"
|
||||||
TAG="$(<"${TMP_PATH}/input")"
|
TAG=$(cat "${TMP_PATH}/input")
|
||||||
[ -z "${TAG}" ] && continue
|
[ -z "${TAG}" ] && return 1
|
||||||
fi
|
fi
|
||||||
dialog --backtitle "$(backtitle)" --title "Update Configs" --aspect 18 \
|
dialog --backtitle "$(backtitle)" --title "Update Configs" --aspect 18 \
|
||||||
--infobox "Downloading ${TAG}" 0 0
|
--infobox "Downloading ${TAG}" 0 0
|
||||||
@ -1140,7 +1140,7 @@ function updateMenu() {
|
|||||||
1 "Latest" \
|
1 "Latest" \
|
||||||
2 "Select Version" \
|
2 "Select Version" \
|
||||||
2>"${TMP_PATH}/opts"
|
2>"${TMP_PATH}/opts"
|
||||||
opts="$(<"${TMP_PATH}/opts")"
|
opts=$(cat ${TMP_PATH}/opts)
|
||||||
[ -z "${opts}" ] && return 1
|
[ -z "${opts}" ] && return 1
|
||||||
if [ ${opts} -eq 1 ]; then
|
if [ ${opts} -eq 1 ]; then
|
||||||
TAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/redpill-lkm/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
TAG="$(curl --insecure -s https://api.github.com/repos/AuxXxilium/redpill-lkm/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
||||||
@ -1153,8 +1153,8 @@ function updateMenu() {
|
|||||||
dialog --backtitle "$(backtitle)" --title "Update LKMs" \
|
dialog --backtitle "$(backtitle)" --title "Update LKMs" \
|
||||||
--inputbox "Type the Version!" 0 0 \
|
--inputbox "Type the Version!" 0 0 \
|
||||||
2>"${TMP_PATH}/input"
|
2>"${TMP_PATH}/input"
|
||||||
TAG="$(<"${TMP_PATH}/input")"
|
TAG=$(cat "${TMP_PATH}/input")
|
||||||
[ -z "${TAG}" ] && continue
|
[ -z "${TAG}" ] && return 1
|
||||||
fi
|
fi
|
||||||
dialog --backtitle "$(backtitle)" --title "Update LKMs" --aspect 18 \
|
dialog --backtitle "$(backtitle)" --title "Update LKMs" --aspect 18 \
|
||||||
--infobox "Downloading ${TAG}" 0 0
|
--infobox "Downloading ${TAG}" 0 0
|
||||||
@ -1773,27 +1773,27 @@ function staticIPMenu() {
|
|||||||
TEXT+="Do you want to change Config?"
|
TEXT+="Do you want to change Config?"
|
||||||
dialog --backtitle "$(backtitle)" --title "DHCP/StaticIP" \
|
dialog --backtitle "$(backtitle)" --title "DHCP/StaticIP" \
|
||||||
--yesno "${TEXT}" 0 0
|
--yesno "${TEXT}" 0 0
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && return 1
|
||||||
dialog --clear --backtitle "$(backtitle)" --title "DHCP/StaticIP" \
|
dialog --clear --backtitle "$(backtitle)" --title "DHCP/StaticIP" \
|
||||||
--menu "DHCP or STATIC?" 0 0 0 \
|
--menu "DHCP or STATIC?" 0 0 0 \
|
||||||
1 "DHCP" \
|
1 "DHCP" \
|
||||||
2 "STATIC" \
|
2 "STATIC" \
|
||||||
2>"${TMP_PATH}/opts"
|
2>"${TMP_PATH}/opts"
|
||||||
opts="$(<"${TMP_PATH}/opts")"
|
opts=$(cat ${TMP_PATH}/opts)
|
||||||
[ -z "${opts}" ] && continue
|
[ -z "${opts}" ] && return 1
|
||||||
if [ ${opts} -eq 1 ]; then
|
if [ ${opts} -eq 1 ]; then
|
||||||
writeConfigKey "static.${ETH}" "false" "${USER_CONFIG_FILE}"
|
writeConfigKey "static.${ETH}" "false" "${USER_CONFIG_FILE}"
|
||||||
elif [ ${opts} -eq 2 ]; then
|
elif [ ${opts} -eq 2 ]; then
|
||||||
dialog --backtitle "$(backtitle)" --title "DHCP/StaticIP" \
|
dialog --backtitle "$(backtitle)" --title "DHCP/StaticIP" \
|
||||||
--inputbox "Type a Static IP\nLike: 192.168.0.1" 0 0 "${IPADDR}" \
|
--inputbox "Type a Static IP\nLike: 192.168.0.1" 0 0 "${IPADDR}" \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && return 1
|
||||||
IPADDR="$(<"${TMP_PATH}/resp")"
|
IPADDR=$(cat "${TMP_PATH}/resp")
|
||||||
dialog --backtitle "$(backtitle)" --title "DHCP/StaticIP" \
|
dialog --backtitle "$(backtitle)" --title "DHCP/StaticIP" \
|
||||||
--inputbox "Type a Netmask\nLike: 24" 0 0 "${NETMASK}" \
|
--inputbox "Type a Netmask\nLike: 24" 0 0 "${NETMASK}" \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
[ $? -ne 0 ] && continue
|
[ $? -ne 0 ] && return 1
|
||||||
NETMASK="$(<"${TMP_PATH}/resp")"
|
NETMASK=$(cat "${TMP_PATH}/resp")
|
||||||
writeConfigKey "ip.${ETH}" "${IPADDR}" "${USER_CONFIG_FILE}"
|
writeConfigKey "ip.${ETH}" "${IPADDR}" "${USER_CONFIG_FILE}"
|
||||||
writeConfigKey "netmask.${ETH}" "${NETMASK}" "${USER_CONFIG_FILE}"
|
writeConfigKey "netmask.${ETH}" "${NETMASK}" "${USER_CONFIG_FILE}"
|
||||||
writeConfigKey "static.${ETH}" "true" "${USER_CONFIG_FILE}"
|
writeConfigKey "static.${ETH}" "true" "${USER_CONFIG_FILE}"
|
||||||
@ -1857,20 +1857,20 @@ function resetPassword() {
|
|||||||
if [ ! -f "${TMP_PATH}/menu" ]; then
|
if [ ! -f "${TMP_PATH}/menu" ]; then
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "Reset DSM Password" \
|
dialog --backtitle "$(backtitle)" --colors --title "Reset DSM Password" \
|
||||||
--msgbox "The installed Syno system not found in the currently inserted disks!" 0 0
|
--msgbox "The installed Syno system not found in the currently inserted disks!" 0 0
|
||||||
return
|
return 1
|
||||||
fi
|
fi
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "Reset DSM Password" \
|
dialog --backtitle "$(backtitle)" --colors --title "Reset DSM Password" \
|
||||||
--no-items --menu "Choose a User" 0 0 0 --file "${TMP_PATH}/menu" \
|
--no-items --menu "Choose a User" 0 0 0 --file "${TMP_PATH}/menu" \
|
||||||
2>${TMP_PATH}/resp
|
2>${TMP_PATH}/resp
|
||||||
[ $? -ne 0 ] && return
|
[ $? -ne 0 ] && return 1
|
||||||
USER="$(cat "${TMP_PATH}/resp" | awk '{print $1}')"
|
USER="$(cat "${TMP_PATH}/resp" | awk '{print $1}')"
|
||||||
[ -z "${USER}" ] && return
|
[ -z "${USER}" ] && return 1
|
||||||
while true; do
|
while true; do
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "Reset DSM Password" \
|
dialog --backtitle "$(backtitle)" --colors --title "Reset DSM Password" \
|
||||||
--inputbox "Type a new Password for User ${USER}" 0 70 "${CMDLINE[${NAME}]}" \
|
--inputbox "Type a new Password for User ${USER}" 0 70 "${CMDLINE[${NAME}]}" \
|
||||||
2>${TMP_PATH}/resp
|
2>${TMP_PATH}/resp
|
||||||
[ $? -ne 0 ] && break 2
|
[ $? -ne 0 ] && break 2
|
||||||
VALUE="$(<"${TMP_PATH}/resp")"
|
VALUE=$(cat "${TMP_PATH}/resp")
|
||||||
[ -n "${VALUE}" ] && break
|
[ -n "${VALUE}" ] && break
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "Reset DSM Password" \
|
dialog --backtitle "$(backtitle)" --colors --title "Reset DSM Password" \
|
||||||
--msgbox "Invalid Password" 0 0
|
--msgbox "Invalid Password" 0 0
|
||||||
@ -1904,7 +1904,7 @@ function bootipwaittime() {
|
|||||||
dialog --backtitle "$(backtitle)" --colors --title "Boot IP Waittime" \
|
dialog --backtitle "$(backtitle)" --colors --title "Boot IP Waittime" \
|
||||||
--default-item "${BOOTIPWAIT}" --no-items --menu "Choose Waittime(seconds)\nto get an IP" 0 0 0 ${ITEMS} \
|
--default-item "${BOOTIPWAIT}" --no-items --menu "Choose Waittime(seconds)\nto get an IP" 0 0 0 ${ITEMS} \
|
||||||
2>"${TMP_PATH}/resp"
|
2>"${TMP_PATH}/resp"
|
||||||
resp="$(cat ${TMP_PATH}/resp 2>/dev/null)"
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
[ -z "${resp}" ] && return 1
|
[ -z "${resp}" ] && return 1
|
||||||
BOOTIPWAIT=${resp}
|
BOOTIPWAIT=${resp}
|
||||||
writeConfigKey "arc.bootipwait" "${BOOTIPWAIT}" "${USER_CONFIG_FILE}"
|
writeConfigKey "arc.bootipwait" "${BOOTIPWAIT}" "${USER_CONFIG_FILE}"
|
||||||
@ -1922,7 +1922,7 @@ function saveMenu() {
|
|||||||
mkdir -p "${RDXZ_PATH}"
|
mkdir -p "${RDXZ_PATH}"
|
||||||
(cd "${RDXZ_PATH}"; xz -dc <"${PART3_PATH}/initrd-arc" | cpio -idm) >/dev/null 2>&1 || true
|
(cd "${RDXZ_PATH}"; xz -dc <"${PART3_PATH}/initrd-arc" | cpio -idm) >/dev/null 2>&1 || true
|
||||||
rm -rf "${RDXZ_PATH}/opt/arc"
|
rm -rf "${RDXZ_PATH}/opt/arc"
|
||||||
cp -Rf "/opt" "${RDXZ_PATH}"
|
cp -Rf "$(dirname ${ARC_PATH})" "${RDXZ_PATH}"
|
||||||
(cd "${RDXZ_PATH}"; find . 2>/dev/null | cpio -o -H newc -R root:root | xz --check=crc32 >"${PART3_PATH}/initrd-arc") || true
|
(cd "${RDXZ_PATH}"; find . 2>/dev/null | cpio -o -H newc -R root:root | xz --check=crc32 >"${PART3_PATH}/initrd-arc") || true
|
||||||
rm -rf "${RDXZ_PATH}"
|
rm -rf "${RDXZ_PATH}"
|
||||||
dialog --backtitle "$(backtitle)" --colors --aspect 18 \
|
dialog --backtitle "$(backtitle)" --colors --aspect 18 \
|
||||||
@ -1936,34 +1936,34 @@ function formatdisks() {
|
|||||||
while read -r KNAME KMODEL; do
|
while read -r KNAME KMODEL; do
|
||||||
[ -z "${KNAME}" ] && continue
|
[ -z "${KNAME}" ] && continue
|
||||||
[[ "${KNAME}" = /dev/md* ]] && continue
|
[[ "${KNAME}" = /dev/md* ]] && continue
|
||||||
[ -z "${KMODEL}" ] && KMODEL="${TYPE}"
|
[ -z "${KMODEL}" ] && KMODEL="Partition"
|
||||||
echo "${KNAME}" | grep -q "${LOADER_DISK}" && continue
|
echo "${KNAME}" | grep -q "${LOADER_DISK}" && continue
|
||||||
echo "\"${KNAME}\" \"${KMODEL}\" \"off\"" >>"${TMP_PATH}/opts"
|
echo "\"${KNAME}\" \"${KMODEL}\" \"off\"" >>"${TMP_PATH}/opts"
|
||||||
done <<<$(lsblk -pno KNAME,MODEL,TYPE)
|
done <<<$(lsblk -pno KNAME,MODEL)
|
||||||
if [ ! -f "${TMP_PATH}/opts" ]; then
|
if [ ! -f "${TMP_PATH}/opts" ]; then
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "Format Disks" \
|
dialog --backtitle "$(backtitle)" --colors --title "Format Disks" \
|
||||||
--msgbox "No disk found!" 0 0
|
--msgbox "No disk found!" 0 0
|
||||||
return
|
return 1
|
||||||
fi
|
fi
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "Format Disks" \
|
dialog --backtitle "$(backtitle)" --colors --title "Format Disks" \
|
||||||
--checklist "Select Disk(s)" 0 0 0 --file "${TMP_PATH}/opts" \
|
--checklist "Select Disk(s)" 0 0 0 --file "${TMP_PATH}/opts" \
|
||||||
2>${TMP_PATH}/resp
|
2>${TMP_PATH}/resp
|
||||||
[ $? -ne 0 ] && return
|
[ $? -ne 0 ] && return
|
||||||
RESP=$(<"${TMP_PATH}/resp")
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
[ -z "${RESP}" ] && return
|
[ -z "${resp}" ] && return
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "Format Disks" \
|
dialog --backtitle "$(backtitle)" --colors --title "Format Disks" \
|
||||||
--yesno "Warning:\nThis operation is irreversible. Please backup important data. Do you want to continue?" 0 0
|
--yesno "Warning:\nThis operation is irreversible. Please backup important data. Do you want to continue?" 0 0
|
||||||
[ $? -ne 0 ] && return
|
[ $? -ne 0 ] && return
|
||||||
if [ $(ls /dev/md* 2>/dev/null | wc -l) -gt 0 ]; then
|
if [ $(ls /dev/md[0-9]* 2>/dev/null | wc -l) -gt 0 ]; then
|
||||||
dialog --backtitle "$(backtitle)" --colors --title "Format Disks" \
|
dialog --backtitle "$(backtitle)" --colors --title "Format Disks" \
|
||||||
--yesno "Warning:\nThe current HDD are in Raid, do you still want to format them?" 0 0
|
--yesno "Warning:\nThe current HDD(s) are in Raid, do you still want to format them?" 0 0
|
||||||
[ $? -ne 0 ] && return
|
[ $? -ne 0 ] && return
|
||||||
for I in $(ls /dev/md* 2>/dev/null); do
|
for I in $(ls /dev/md[0-9]* 2>/dev/null); do
|
||||||
mdadm -S "${I}"
|
mdadm -S "${I}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
(
|
(
|
||||||
for I in ${RESP}; do
|
for I in ${resp}; do
|
||||||
if [[ "${I}" = /dev/mmc* ]]; then
|
if [[ "${I}" = /dev/mmc* ]]; then
|
||||||
echo y | mkfs.ext4 -T largefile4 -E nodiscard "${I}"
|
echo y | mkfs.ext4 -T largefile4 -E nodiscard "${I}"
|
||||||
else
|
else
|
||||||
@ -1976,6 +1976,22 @@ function formatdisks() {
|
|||||||
--msgbox "Formatting is complete." 0 0
|
--msgbox "Formatting is complete." 0 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# install opkg package manager
|
||||||
|
function package() {
|
||||||
|
dialog --backtitle "$(backtitle)" --colors --title "Package" \
|
||||||
|
--yesno "This installs opkg Package Management,\nallowing you to install more Tools for use and debugging.\nDo you want to continue?" 0 0
|
||||||
|
[ $? -ne 0 ] && return
|
||||||
|
(
|
||||||
|
wget -O - http://bin.entware.net/x64-k3.2/installer/generic.sh | /bin/sh
|
||||||
|
opkg update
|
||||||
|
#opkg install python3 python3-pip
|
||||||
|
) 2>&1 | dialog --backtitle "$(backtitle)" --colors --title "Package" \
|
||||||
|
--progressbox "Installing opkg ..." 20 100
|
||||||
|
dialog --backtitle "$(backtitle)" --colors --title "Package" \
|
||||||
|
--msgbox "Installation is complete.\nPlease reconnect to ssh/web,\nor execute 'source ~/.bashrc'" 0 0
|
||||||
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# let user format disks from inside arc
|
# let user format disks from inside arc
|
||||||
function forcessh() {
|
function forcessh() {
|
||||||
@ -2008,6 +2024,78 @@ EOF
|
|||||||
--msgbox "${MSG}" 0 0
|
--msgbox "${MSG}" 0 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Clone Loader Disk
|
||||||
|
function cloneLoader() {
|
||||||
|
rm -f "${TMP_PATH}/opts"
|
||||||
|
while read -r KNAME KMODEL; do
|
||||||
|
[ -z "${KNAME}" ] && continue
|
||||||
|
[ -z "${KMODEL}" ] && KMODEL="${TYPE}"
|
||||||
|
echo "${KNAME}" | grep -q "${LOADER_DISK}" && continue
|
||||||
|
echo "\"${KNAME}\" \"${KMODEL}\" \"off\"" >>"${TMP_PATH}/opts"
|
||||||
|
done <<<$(lsblk -dpno KNAME,MODEL,TYPE)
|
||||||
|
if [ ! -f "${TMP_PATH}/opts" ]; then
|
||||||
|
dialog --backtitle "$(backtitle)" --colors --title "Clone Loader" \
|
||||||
|
--msgbox "No disk found!" 0 0
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
dialog --backtitle "$(backtitle)" --colors --title "Clone Loader" \
|
||||||
|
--radiolist "Choose a Destination" 0 0 0 --file "${TMP_PATH}/opts" \
|
||||||
|
2>${TMP_PATH}/resp
|
||||||
|
[ $? -ne 0 ] && return
|
||||||
|
resp=$(cat ${TMP_PATH}/resp)
|
||||||
|
if [ -z "${resp}" ]; then
|
||||||
|
dialog --backtitle "$(backtitle)" --colors --title "Clone Loader" \
|
||||||
|
--msgbox "No disk selected!" 0 0
|
||||||
|
return
|
||||||
|
else
|
||||||
|
SIZE=$(df -m ${resp} 2>/dev/null | awk 'NR==2 {print $2}')
|
||||||
|
if [ ${SIZE:-0} -lt 1024 ]; then
|
||||||
|
dialog --backtitle "$(backtitle)" --colors --title "Clone Loader" \
|
||||||
|
--msgbox "Disk ${resp} size is less than 1GB and cannot be cloned!" 0 0
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
MSG=""
|
||||||
|
MSG+="Warning:\nDisk ${resp} will be formatted and written to the bootloader. Please confirm that important data has been backed up. \nDo you want to continue?"
|
||||||
|
dialog --backtitle "$(backtitle)" --colors --title "Clone Loader" \
|
||||||
|
--yesno "${MSG}" 0 0
|
||||||
|
[ $? -ne 0 ] && return
|
||||||
|
fi
|
||||||
|
(
|
||||||
|
rm -rf "${PART3_PATH}/dl"
|
||||||
|
CLEARCACHE=0
|
||||||
|
|
||||||
|
gzip -dc "${CUSTOM_PATH}/grub.img.gz" | dd of="${resp}" bs=1M conv=fsync status=progress
|
||||||
|
hdparm -z "${resp}" # reset disk cache
|
||||||
|
fdisk -l "${resp}"
|
||||||
|
sleep 3
|
||||||
|
|
||||||
|
mkdir -p "${TMP_PATH}/sdX1"
|
||||||
|
mount "$(lsblk "${resp}" -pno KNAME,LABEL 2>/dev/null | grep ARC1 | awk '{print $1}')" "${TMP_PATH}/sdX1"
|
||||||
|
cp -vRf "${PART1_PATH}/". "${TMP_PATH}/sdX1/"
|
||||||
|
sync
|
||||||
|
umount "${TMP_PATH}/sdX1"
|
||||||
|
|
||||||
|
mkdir -p "${TMP_PATH}/sdX2"
|
||||||
|
mount "$(lsblk "${resp}" -pno KNAME,LABEL 2>/dev/null | grep ARC2 | awk '{print $1}')" "${TMP_PATH}/sdX2"
|
||||||
|
cp -vRf "${PART2_PATH}/". "${TMP_PATH}/sdX2/"
|
||||||
|
sync
|
||||||
|
umount "${TMP_PATH}/sdX2"
|
||||||
|
|
||||||
|
mkdir -p "${TMP_PATH}/sdX3"
|
||||||
|
mount "$(lsblk "${resp}" -pno KNAME,LABEL 2>/dev/null | grep ARC3 | awk '{print $1}')" "${TMP_PATH}/sdX3"
|
||||||
|
cp -vRf "${PART3_PATH}/". "${TMP_PATH}/sdX3/"
|
||||||
|
sync
|
||||||
|
umount "${TMP_PATH}/sdX3"
|
||||||
|
sleep 3
|
||||||
|
) 2>&1 | dialog --backtitle "$(backtitle)" --colors --title "Clone Loader" \
|
||||||
|
--progressbox "Cloning ..." 20 100
|
||||||
|
dialog --backtitle "$(backtitle)" --colors --title "Clone Loader" \
|
||||||
|
--msgbox "Bootloader has been cloned to disk ${resp},\nplease remove the current bootloader disk!\nReboot?" 0 0
|
||||||
|
rebootTo config
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# let user delete Loader Boot Files
|
# let user delete Loader Boot Files
|
||||||
function resetLoader() {
|
function resetLoader() {
|
||||||
|
@ -11,30 +11,21 @@ BUS=$(getBus "${LOADER_DISK}")
|
|||||||
# Check if machine has EFI
|
# Check if machine has EFI
|
||||||
[ -d /sys/firmware/efi ] && EFI=1 || EFI=0
|
[ -d /sys/firmware/efi ] && EFI=1 || EFI=0
|
||||||
|
|
||||||
# Print text centralized
|
# Print Title centralized
|
||||||
clear
|
clear
|
||||||
COLUMNS=${COLUMNS:-50}
|
COLUMNS=${COLUMNS:-50}
|
||||||
TITLE="${ARC_TITLE}"
|
BANNER="$(figlet -c -w "$(((${COLUMNS})))" "Arc-C Loader")"
|
||||||
|
TITLE="Version:"
|
||||||
|
TITLE+=" ${ARC_TITLE}"
|
||||||
printf "\033[1;30m%*s\n" ${COLUMNS} ""
|
printf "\033[1;30m%*s\n" ${COLUMNS} ""
|
||||||
printf "\033[1;30m%*s\033[A\n" ${COLUMNS} ""
|
printf "\033[1;30m%*s\033[A\n" ${COLUMNS} ""
|
||||||
|
printf "\033[1;34m%*s\033[0m\n" ${COLUMNS} "${BANNER}"
|
||||||
printf "\033[1;34m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}"
|
printf "\033[1;34m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}"
|
||||||
printf "\033[1;30m%*s\033[0m\n" ${COLUMNS} ""
|
printf "\033[1;30m%*s\033[0m\n" ${COLUMNS} ""
|
||||||
TITLE="BOOTING:"
|
[ ${EFI} -eq 1 ] && TITLE="[UEFI]" || TITLE="[Legacy]"
|
||||||
[ ${EFI} -eq 1 ] && TITLE+=" [UEFI]" || TITLE+=" [Legacy]"
|
|
||||||
TITLE+=" [${BUS}]"
|
TITLE+=" [${BUS}]"
|
||||||
printf "\033[1;34m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}"
|
printf "\033[1;34m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}"
|
||||||
|
|
||||||
echo
|
|
||||||
cat <<EOF
|
|
||||||
### ##### #### ####
|
|
||||||
# # # # # # # #
|
|
||||||
# # # # # #
|
|
||||||
####### ##### # ### #
|
|
||||||
# # # # # # # #
|
|
||||||
# # # # #### ####
|
|
||||||
EOF
|
|
||||||
echo
|
|
||||||
|
|
||||||
# Check if DSM zImage/Ramdisk is changed, patch it if necessary, update Files if necessary
|
# Check if DSM zImage/Ramdisk is changed, patch it if necessary, update Files if necessary
|
||||||
ZIMAGE_HASH="$(readConfigKey "zimage-hash" "${USER_CONFIG_FILE}")"
|
ZIMAGE_HASH="$(readConfigKey "zimage-hash" "${USER_CONFIG_FILE}")"
|
||||||
ZIMAGE_HASH_CUR="$(sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print $1}')"
|
ZIMAGE_HASH_CUR="$(sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print $1}')"
|
||||||
@ -132,8 +123,8 @@ if [ ! "${BUS}" = "usb" ]; then
|
|||||||
fi
|
fi
|
||||||
CMDLINE['panic']="${KERNELPANIC:-0}"
|
CMDLINE['panic']="${KERNELPANIC:-0}"
|
||||||
CMDLINE['console']="ttyS0,115200n8"
|
CMDLINE['console']="ttyS0,115200n8"
|
||||||
CMDLINE['no_console_suspend']="1"
|
#CMDLINE['no_console_suspend']="1"
|
||||||
CMDLINE['consoleblank']="0"
|
CMDLINE['consoleblank']="600"
|
||||||
CMDLINE['earlyprintk']=""
|
CMDLINE['earlyprintk']=""
|
||||||
CMDLINE['earlycon']="uart8250,io,0x3f8,115200n8"
|
CMDLINE['earlycon']="uart8250,io,0x3f8,115200n8"
|
||||||
|
|
||||||
@ -144,6 +135,7 @@ elif [ "${EMMCBOOT}" = "true" ]; then
|
|||||||
CMDLINE['root']="/dev/mmcblk0p1"
|
CMDLINE['root']="/dev/mmcblk0p1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ ! "${MODEL}" = "SA6400" ] && CMDLINE['elevator']="elevator"
|
||||||
CMDLINE['loglevel']="15"
|
CMDLINE['loglevel']="15"
|
||||||
CMDLINE['log_buf_len']="32M"
|
CMDLINE['log_buf_len']="32M"
|
||||||
|
|
||||||
|
@ -104,10 +104,13 @@ function generateMacAddress() {
|
|||||||
PRE="$(readModelArray "${1}" "serial.macpre")"
|
PRE="$(readModelArray "${1}" "serial.macpre")"
|
||||||
SUF="$(printf '%02x%02x%02x' $((${RANDOM} % 256)) $((${RANDOM} % 256)) $((${RANDOM} % 256)))"
|
SUF="$(printf '%02x%02x%02x' $((${RANDOM} % 256)) $((${RANDOM} % 256)) $((${RANDOM} % 256)))"
|
||||||
NUM=${2:-1}
|
NUM=${2:-1}
|
||||||
|
MACS=""
|
||||||
for I in $(seq 1 ${NUM}); do
|
for I in $(seq 1 ${NUM}); do
|
||||||
printf '%06x%06x' $((0x${PRE:-"001132"})) $(($((0x${SUF})) + ${I}))
|
MACS+="$(printf '%06x%06x' $((0x${PRE:-"001132"})) $(($((0x${SUF})) + ${I})))"
|
||||||
[ ${I} -lt ${NUM} ] && printf ' '
|
[ ${I} -lt ${NUM} ] && MACS+=" "
|
||||||
done
|
done
|
||||||
|
echo "${MACS}"
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -122,19 +125,16 @@ function validateSerial() {
|
|||||||
P=${2:4:3}
|
P=${2:4:3}
|
||||||
L=${#2}
|
L=${#2}
|
||||||
if [ ${L} -ne 13 ]; then
|
if [ ${L} -ne 13 ]; then
|
||||||
echo 0
|
return 0
|
||||||
return
|
|
||||||
fi
|
fi
|
||||||
echo "${PREFIX}" | grep -q "${S}"
|
echo "${PREFIX}" | grep -q "${S}"
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
echo 0
|
return 0
|
||||||
return
|
|
||||||
fi
|
fi
|
||||||
if [ "${MIDDLE}" != "${P}" ]; then
|
if [ "${MIDDLE}" != "${P}" ]; then
|
||||||
echo 0
|
return 0
|
||||||
return
|
|
||||||
fi
|
fi
|
||||||
echo 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -196,6 +196,7 @@ function getBus() {
|
|||||||
# usb/scsi(sata/ide)/virtio(scsi/virtio)/mmc/nvme
|
# usb/scsi(sata/ide)/virtio(scsi/virtio)/mmc/nvme
|
||||||
[ -z "${BUS}" ] && BUS=$(lsblk -dpno KNAME,SUBSYSTEMS 2>/dev/null | grep "${1} " | awk -F':' '{print $(NF-1)}' | sed 's/_host//')
|
[ -z "${BUS}" ] && BUS=$(lsblk -dpno KNAME,SUBSYSTEMS 2>/dev/null | grep "${1} " | awk -F':' '{print $(NF-1)}' | sed 's/_host//')
|
||||||
echo "${BUS}"
|
echo "${BUS}"
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -211,6 +212,7 @@ function getIP() {
|
|||||||
[ -z "${IP}" ] && IP=$(ip addr show | grep -E "inet .* eth" | awk '{print $2}' | cut -f1 -d'/' | head -1)
|
[ -z "${IP}" ] && IP=$(ip addr show | grep -E "inet .* eth" | awk '{print $2}' | cut -f1 -d'/' | head -1)
|
||||||
fi
|
fi
|
||||||
echo "${IP}"
|
echo "${IP}"
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -306,6 +308,7 @@ EOF
|
|||||||
done
|
done
|
||||||
|
|
||||||
rm -f ${TMP_PATH}/ethlist
|
rm -f ${TMP_PATH}/ethlist
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -389,7 +392,9 @@ function livepatch() {
|
|||||||
# Rebooting
|
# Rebooting
|
||||||
# (based on pocopico's TCRP code)
|
# (based on pocopico's TCRP code)
|
||||||
function rebootTo() {
|
function rebootTo() {
|
||||||
[[ "${1}" != "junior" && "${1}" != "config" ]] && exit 1
|
MODES="config recovery junior"
|
||||||
|
[ -z "${1}" ] && exit 1
|
||||||
|
if ! echo "${MODES}" | grep -qw "${1}"; then exit 1; fi
|
||||||
# echo "Rebooting to ${1} mode"
|
# echo "Rebooting to ${1} mode"
|
||||||
GRUBPATH="$(dirname $(find ${BOOTLOADER_PATH}/ -name grub.cfg | head -1))"
|
GRUBPATH="$(dirname $(find ${BOOTLOADER_PATH}/ -name grub.cfg | head -1))"
|
||||||
ENVFILE="${GRUBPATH}/grubenv"
|
ENVFILE="${GRUBPATH}/grubenv"
|
||||||
|
@ -8,6 +8,7 @@ function getnet() {
|
|||||||
[ -n "${ARCMAC}" ] && writeConfigKey "mac.${ETH}" "${ARCMAC}" "${USER_CONFIG_FILE}"
|
[ -n "${ARCMAC}" ] && writeConfigKey "mac.${ETH}" "${ARCMAC}" "${USER_CONFIG_FILE}"
|
||||||
[ -z "${ARCMAC}" ] && break
|
[ -z "${ARCMAC}" ] && break
|
||||||
ARCMACNUM=$((${ARCMACNUM} + 1))
|
ARCMACNUM=$((${ARCMACNUM} + 1))
|
||||||
|
ARCMAC=""
|
||||||
done
|
done
|
||||||
writeConfigKey "arc.macsys" "hardware" "${USER_CONFIG_FILE}"
|
writeConfigKey "arc.macsys" "hardware" "${USER_CONFIG_FILE}"
|
||||||
MACSYS="$(readConfigKey "arc.macsys" "${USER_CONFIG_FILE}")"
|
MACSYS="$(readConfigKey "arc.macsys" "${USER_CONFIG_FILE}")"
|
||||||
|
@ -11,12 +11,15 @@ set -e
|
|||||||
# Get Loader Disk Bus
|
# Get Loader Disk Bus
|
||||||
BUS=$(getBus "${LOADER_DISK}")
|
BUS=$(getBus "${LOADER_DISK}")
|
||||||
|
|
||||||
# Shows title
|
# Print Title centralized
|
||||||
clear
|
clear
|
||||||
[ -z "${COLUMNS}" ] && COLUMNS=50
|
COLUMNS=${COLUMNS:-50}
|
||||||
TITLE="${ARC_TITLE}"
|
BANNER="$(figlet -c -w "$(((${COLUMNS})))" "Arc-C Loader")"
|
||||||
|
TITLE="Version:"
|
||||||
|
TITLE+=" ${ARC_TITLE}"
|
||||||
printf "\033[1;30m%*s\n" ${COLUMNS} ""
|
printf "\033[1;30m%*s\n" ${COLUMNS} ""
|
||||||
printf "\033[1;30m%*s\033[A\n" ${COLUMNS} ""
|
printf "\033[1;30m%*s\033[A\n" ${COLUMNS} ""
|
||||||
|
printf "\033[1;34m%*s\033[0m\n" ${COLUMNS} "${BANNER}"
|
||||||
printf "\033[1;34m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}"
|
printf "\033[1;34m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}"
|
||||||
printf "\033[1;30m%*s\033[0m\n" ${COLUMNS} ""
|
printf "\033[1;30m%*s\033[0m\n" ${COLUMNS} ""
|
||||||
|
|
||||||
@ -106,10 +109,11 @@ writeConfigKey "device.nic" "${NIC}" "${USER_CONFIG_FILE}"
|
|||||||
VID="0x46f4"
|
VID="0x46f4"
|
||||||
PID="0x0001"
|
PID="0x0001"
|
||||||
|
|
||||||
|
BUSLIST="usb sata scsi nvme mmc"
|
||||||
if [ "${BUS}" = "usb" ]; then
|
if [ "${BUS}" = "usb" ]; then
|
||||||
VID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_VENDOR_ID | cut -d= -f2)"
|
VID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_VENDOR_ID | cut -d= -f2)"
|
||||||
PID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_MODEL_ID | cut -d= -f2)"
|
PID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_MODEL_ID | cut -d= -f2)"
|
||||||
elif [[ "${BUS}" != "sata" && "${BUS}" != "scsi" && "${BUS}" != "nvme" && "${BUS}" != "mmc" ]]; then
|
elif ! echo "${BUSLIST}" | grep -wq "${BUS}"; then
|
||||||
die "Loader disk is not USB or SATA/SCSI/NVME/eMMC DoM"
|
die "Loader disk is not USB or SATA/SCSI/NVME/eMMC DoM"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -103,6 +103,7 @@ function getAddons() {
|
|||||||
echo "Extracting ${PKG} to ${DEST_PATH}/${ADDON}"
|
echo "Extracting ${PKG} to ${DEST_PATH}/${ADDON}"
|
||||||
tar -xaf "${PKG}" -C "${DEST_PATH}/${ADDON}"
|
tar -xaf "${PKG}" -C "${DEST_PATH}/${ADDON}"
|
||||||
done
|
done
|
||||||
|
rm -f "${CACHE_FILE}"
|
||||||
echo "Getting Addons end - ${TAG}"
|
echo "Getting Addons end - ${TAG}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user