Skip to content

Commit

Permalink
Small cosmetic and code styling fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Dec 5, 2024
1 parent 08d4217 commit 76b4fb3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tools/modules/system/manage_odroid_board.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ function manage_odroid_board() {
list+=("${board_id[${board_num}]}" "${board_list[${board_num}]}" "${state}")
done

target_board=$($DIALOG --notags --title "Select optimised board configuration" --radiolist "" 10 42 4 "${list[@]}" 3>&1 1>&2 2>&3)
if [[ $? == 0 ]]; then
if target_board=$($DIALOG --notags --title "Select optimised board configuration" \
--radiolist "" 10 42 4 "${list[@]}" 3>&1 1>&2 2>&3); then
sed -i "s/^board_name=.*/board_name=${target_board}/" ${env_file} 2> /dev/null && \
grep -q "^board_name=${target_board}" ${env_file} 2>/dev/null || \
echo "board_name=${target_board}" >> ${env_file}
sed -i "s/^BOARD_NAME.*/BOARD_NAME=\"Odroid ${target_board^^}\"/" /etc/armbian-release

$DIALOG --title " Reboot required " --yes-button "Reboot" \
--no-button "Cancel" --yesno "A reboot is required to apply the changes. Shall we reboot now?" 7 34
[[ $? == 0 ]] && reboot
if $DIALOG --title " Reboot required " --yes-button "Reboot" --no-button "Cancel" --yesno \
"A reboot is required to apply the changes. Shall we reboot now?" 7 34; then
reboot
fi
fi
}

0 comments on commit 76b4fb3

Please sign in to comment.