Unverified Commit 92ad8e77 authored by Igor Pečovnik's avatar Igor Pečovnik Committed by GitHub
Browse files

Merge pull request #48 from jcstaudt/master

Spelling and grammar
parents 7341bb89 9a1c618a
# Armbian configuration utility # Armbian configuration utility
Utility for configuring your board, adjusting services and installing applications. It comes with Armbian by default. Utility for configuring your board, adjusting services and installing applications.
It comes with Armbian by default.
Login as root and type: Login as root and type:
...@@ -11,21 +12,21 @@ Login as root and type: ...@@ -11,21 +12,21 @@ Login as root and type:
- **system** - **system**
- install to SATA, eMMC, NAND or USB - install to SATA, eMMC, NAND or USB
- freeze and unfreeze kernel and BSP upgrades - freeze and unfreeze kernel and BSP upgrades
- switching between avaliable kernels and nightly builds - switching between available kernels and nightly builds
- edit boot environment - edit boot environment
- reconfigure board settings with DT overlays or FEX (Allwinner legacy) - reconfigure board settings with DT overlays or FEX (Allwinner legacy)
- select dedicated DTB (Solidrun imx6 and Odroid XU4/HC1/HC2 boards) - select dedicated DTB (Solidrun i.MX6 and Odroid XU4/HC1/HC2 boards)
- adjust SSH daemon features - adjust SSH daemon features
- 3G/4G LTE modem management - 3G/4G LTE modem management
- run apt update and upgrade - run apt update and upgrade
- toogle BASH/ZSH with [Oh My ZSH](https://ohmyz.sh/) and [tmux](https://en.wikipedia.org/wiki/Tmux) - toggle BASH/ZSH with [Oh My ZSH](https://ohmyz.sh/) and [tmux](https://en.wikipedia.org/wiki/Tmux)
- toggle desktop and login manager (desktop builds) - toggle desktop and login manager (desktop builds)
- adjusting the display resolution (some boards) - adjusting the display resolution (some boards)
- enabling read only root filesystem (Ubuntu) - enabling read only root filesystem (Ubuntu)
- **network** - **network**
- select dynamic or static IP address - select dynamic or static IP address
- hotspot management. Automatic detection of: nl80211, realtek, 802.11n, 802.11a and 802.11ac - hotspot management. Automatic detection of: nl80211, realtek, 802.11n, 802.11a and 802.11ac
- iperf3. Toogle bandwidth measuring server - iperf3. Toggle bandwidth measuring server
- connect to wireless - connect to wireless
- install IR support - install IR support
- install support, pair and connect Bluetooth devices - install support, pair and connect Bluetooth devices
...@@ -54,7 +55,7 @@ Login as root and type: ...@@ -54,7 +55,7 @@ Login as root and type:
- [MiniDLNA](http://minidlna.sourceforge.net/) *(media sharing)* - [MiniDLNA](http://minidlna.sourceforge.net/) *(media sharing)*
- monitoring tools - monitoring tools
- create diagnostics report - create diagnostics report
- toggle kernel headers, RDP service, Thunderbird and Libreoffice (desktop builds) - toggle kernel headers, RDP service, Thunderbird and LibreOffice (desktop builds)
- **help** - **help**
- Links to documentation, support and sources - Links to documentation, support and sources
...@@ -81,7 +82,7 @@ Login as root and type: ...@@ -81,7 +82,7 @@ Login as root and type:
|Transmission (torrent server)|:heavy_check_mark:|:heavy_check_mark:|07.03.2019| |Transmission (torrent server)|:heavy_check_mark:|:heavy_check_mark:|07.03.2019|
|ISPConfig (WEB, SMTP, POP, IMAP, FTPD, MYSQL server)|:heavy_check_mark:|:heavy_check_mark:|29.09.2018| |ISPConfig (WEB, SMTP, POP, IMAP, FTPD, MYSQL server)|:heavy_check_mark:|:heavy_check_mark:|29.09.2018|
|NCP (Nextcloud personal cloud)|:heavy_check_mark:|n/a|29.09.2018| |NCP (Nextcloud personal cloud)|:heavy_check_mark:|n/a|29.09.2018|
|Openmediavault NAS (NAS server)|:heavy_check_mark:|n/a|29.09.2018| |OpenMediaVault NAS (NAS server)|:heavy_check_mark:|n/a|29.09.2018|
|OpenHAB2 (Smarthome suite)|:heavy_check_mark:|:heavy_check_mark:|07.03.2019| |OpenHAB2 (Smarthome suite)|:heavy_check_mark:|:heavy_check_mark:|07.03.2019|
|Home Assistant (Smarthome suite within Docker)|:heavy_check_mark:|:heavy_check_mark:|09.03.2019| |Home Assistant (Smarthome suite within Docker)|:heavy_check_mark:|:heavy_check_mark:|09.03.2019|
|PI hole (ad blocker)|:heavy_check_mark:|:heavy_check_mark:|09.03.2019| |PI hole (ad blocker)|:heavy_check_mark:|:heavy_check_mark:|09.03.2019|
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# #
# check for root priveleges # check for root privileges
# #
if [[ $EUID != 0 ]]; then if [[ $EUID != 0 ]]; then
echo "This tool requires root privileges. Try again with \"sudo \" please ..." >&2 echo "This tool requires root privileges. Try again with \"sudo \" please ..." >&2
...@@ -25,7 +25,7 @@ fi ...@@ -25,7 +25,7 @@ fi
# #
wget -q --spider http://github.com wget -q --spider http://github.com
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
read -n 1 -s -p "Warning. Configurator can't work properly without internet connection. \ read -n 1 -s -p "Warning: Configuration cannot work properly without a working internet connection. \
Press CTRL C to stop to stop or any key to ignore and continue." Press CTRL C to stop to stop or any key to ignore and continue."
fi fi
...@@ -78,22 +78,22 @@ do ...@@ -78,22 +78,22 @@ do
LIST+=( "Help" "Documentation, support, sources" ) LIST+=( "Help" "Documentation, support, sources" )
# count number of menu items to adjust window size # count number of menu items to adjust window size
LISTLENGHT="$((11+${#LIST[@]}/2))" LISTLENGTH="$((11+${#LIST[@]}/2))"
BOXLENGHT=${#LIST[@]} BOXLENGTH=${#LIST[@]}
MENUTITLE="Configure $DISTRO $DISTROID " MENUTITLE="Configure $DISTRO $DISTROID "
[[ -n "${BOARD_NAME/ /}" ]] && MENUTITLE=$MENUTITLE" based \Z1Armbian\Z0 for the \Z1${BOARD_NAME}\Z0 " [[ -n "${BOARD_NAME/ /}" ]] && MENUTITLE=$MENUTITLE" based \Z1Armbian\Z0 for the \Z1${BOARD_NAME}\Z0 "
# main dialog routine # main dialog routine
DIALOG_CANCEL=1 DIALOG_CANCEL=1
DIALOG_ESC=255 DIALOG_ESC=255
TITLELENGHT=${#MENUTITLE} TITLELENGTH=${#MENUTITLE}
[[ "$TITLELENGHT" -lt 60 ]] && TITLELENGHT="60" [[ "$TITLELENGTH" -lt 60 ]] && TITLELENGTH="60"
exec 3>&1 exec 3>&1
selection=$(dialog --colors --backtitle "$BACKTITLE" --title " armbian-config " --clear \ selection=$(dialog --colors --backtitle "$BACKTITLE" --title " armbian-config " --clear \
--cancel-label "Exit" --menu "\n$MENUTITLE \n \nSupport: \Z1https://forum.armbian.com\Z0\n " \ --cancel-label "Exit" --menu "\n$MENUTITLE \n \nSupport: \Z1https://forum.armbian.com\Z0\n " \
$LISTLENGHT ${TITLELENGHT} $BOXLENGHT "${LIST[@]}" 2>&1 1>&3) $LISTLENGTH ${TITLELENGTH} $BOXLENGTH "${LIST[@]}" 2>&1 1>&3)
exit_status=$? exit_status=$?
exec 3>&- exec 3>&-
...@@ -130,4 +130,4 @@ do ...@@ -130,4 +130,4 @@ do
show_box "Info" "$t" "18" show_box "Info" "$t" "18"
;; ;;
esac esac
done done
...@@ -158,7 +158,7 @@ function exceptions () ...@@ -158,7 +158,7 @@ function exceptions ()
# #
# check dpkg status of $1 -- currently only 'not installed at all' case catched # check dpkg status of $1 -- currently only 'not installed at all' case caught
# #
check_if_installed (){ check_if_installed (){
...@@ -206,7 +206,7 @@ stdbuf -i0 -o0 -e0 sed -rn 's/^.*\<([0-9]+)%\[.*$/\1/p' | dialog --backtitle "$B ...@@ -206,7 +206,7 @@ stdbuf -i0 -o0 -e0 sed -rn 's/^.*\<([0-9]+)%\[.*$/\1/p' | dialog --backtitle "$B
# #
# display qr code for google authemtication method # display qr code for authentication method
# #
function display_qr_code() function display_qr_code()
{ {
...@@ -214,9 +214,9 @@ function display_qr_code() ...@@ -214,9 +214,9 @@ function display_qr_code()
SECRET=$(head -1 /root/.google_authenticator) SECRET=$(head -1 /root/.google_authenticator)
qrencode -d 9 -8 -t UTF8 "otpauth://totp/test?secret=$SECRET" qrencode -d 9 -8 -t UTF8 "otpauth://totp/test?secret=$SECRET"
echo -e "\nSetting up your OTP-generator\ echo -e "\nSetting up your OTP-generator\
\nInstall Google Authenticator generator application on your mobile phone from Android market (e.g. FreeOTP) or from F-Droid.\ \nInstall a one-time password authenticator on your mobile device (e.g. FreeOTP) from the Android market or F-Droid.\
\nIn the applications menu click the corresponding button to create a new account and either scan the QR code, or enter the secret key manually:\ \nIn the application menu, click the corresponding button to create a new account and either scan the QR code or enter the secret key manually:\
\n\n$SECRET \n\nNow you should see a new passcode token being generated every 60 seconds on your phone.\n" | fold -sw 38 \n\n$SECRET \n\nYou should now see a new passcode token being generated every 60 seconds on your phone.\n" | fold -sw 38
read -n 1 -s -r -p "Press any key to continue" read -n 1 -s -r -p "Press any key to continue"
} }
...@@ -394,16 +394,16 @@ function other_kernel_version () ...@@ -394,16 +394,16 @@ function other_kernel_version ()
# copy back to main array # copy back to main array
LIST=("${new_list[@]}") LIST=("${new_list[@]}")
LIST_LENGHT=$((${#LIST[@]}/2)); LIST_LENGTH=$((${#LIST[@]}/2));
if [ "$LIST_LENGHT" -eq 0 ]; then if [ "$LIST_LENGTH" -eq 0 ]; then
dialog --backtitle "$BACKTITLE" --title " Warning " --msgbox "\nNo other kernels available!" 7 32 dialog --backtitle "$BACKTITLE" --title " Warning " --msgbox "\nNo other kernels available!" 7 32
else else
beta_disclaimer "Switching between kernels might change functionality of your board or it might fail to boot." beta_disclaimer "Switching between kernels might change functionality of your board or it might fail to boot."
if [[ -n $ACKNOWLEDGEMENT ]]; then if [[ -n $ACKNOWLEDGEMENT ]]; then
exec 3>&1 exec 3>&1
TARGET_VERSION=$(dialog --cancel-label "Cancel" --backtitle "$BACKTITLE" --no-collapse \ TARGET_VERSION=$(dialog --cancel-label "Cancel" --backtitle "$BACKTITLE" --no-collapse \
--title "Switch from" --clear --menu "\n${CURRENT_VERSION} $(uname -r) \n \n" $((9+${LIST_LENGHT})) 62 25 "${LIST[@]}" 2>&1 1>&3) --title "Switch from" --clear --menu "\n${CURRENT_VERSION} $(uname -r) \n \n" $((9+${LIST_LENGTH})) 62 25 "${LIST[@]}" 2>&1 1>&3)
exitstatus=$?; exitstatus=$?;
exec 3>&- exec 3>&-
if [[ $exitstatus = 0 ]]; then if [[ $exitstatus = 0 ]]; then
...@@ -453,13 +453,13 @@ function aval_dtbs () ...@@ -453,13 +453,13 @@ function aval_dtbs ()
LIST=("xu4" "Odroid XU4" "xu3" "Odroid XU3" "xu3l" "Odroid XU3 Lite" "hc1" "Odroid HC1/HC2") LIST=("xu4" "Odroid XU4" "xu3" "Odroid XU3" "xu3l" "Odroid XU3 Lite" "hc1" "Odroid HC1/HC2")
fi fi
LIST_LENGHT=$((${#LIST[@]}/2)); LIST_LENGTH=$((${#LIST[@]}/2));
if [ "$LIST_LENGHT" -eq 1 ]; then if [ "$LIST_LENGTH" -eq 1 ]; then
TARGET_BOARD=${AVAL_KERNEL[0]} TARGET_BOARD=${AVAL_KERNEL[0]}
else else
exec 3>&1 exec 3>&1
TARGET_BOARD=$(dialog --cancel-label "Cancel" --backtitle "$BACKTITLE" --no-collapse \ TARGET_BOARD=$(dialog --cancel-label "Cancel" --backtitle "$BACKTITLE" --no-collapse \
--title "Select optimised board configuration" --clear --menu "" $((6+${LIST_LENGHT})) ${width} 25 "${LIST[@]}" 2>&1 1>&3) --title "Select optimised board configuration" --clear --menu "" $((6+${LIST_LENGTH})) ${width} 25 "${LIST[@]}" 2>&1 1>&3)
exitstatus=$?; exitstatus=$?;
exec 3>&- exec 3>&-
fi fi
...@@ -483,15 +483,15 @@ function get_a20modes () ...@@ -483,15 +483,15 @@ function get_a20modes ()
do do
LIST+=( "${i[0]//[[:blank:]]/}" "" ) LIST+=( "${i[0]//[[:blank:]]/}" "" )
done done
LIST_LENGHT=$((${#LIST[@]}/2)); LIST_LENGTH=$((${#LIST[@]}/2));
#echo $LIST_LENGHT #echo $LIST_LENGTH
#exit #exit
if [ "$LIST_LENGHT" -eq 1 ]; then if [ "$LIST_LENGTH" -eq 1 ]; then
SCREEN_RESOLUTION=${SCREEN_RESOLUTION[0]} SCREEN_RESOLUTION=${SCREEN_RESOLUTION[0]}
else else
exec 3>&1 exec 3>&1
SCREEN_RESOLUTION=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \ SCREEN_RESOLUTION=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \
--title "Select video mode" --clear --menu "" $((6+${LIST_LENGHT})) 25 $((1+${LIST_LENGHT})) "${LIST[@]}" 2>&1 1>&3) --title "Select video mode" --clear --menu "" $((6+${LIST_LENGTH})) 25 $((1+${LIST_LENGTH})) "${LIST[@]}" 2>&1 1>&3)
exec 3>&- exec 3>&-
fi fi
...@@ -514,15 +514,15 @@ function get_odroidmodes () ...@@ -514,15 +514,15 @@ function get_odroidmodes ()
do do
LIST+=( "${i[0]//[[:blank:]]/}" "" ) LIST+=( "${i[0]//[[:blank:]]/}" "" )
done done
LIST_LENGHT=$((${#LIST[@]}/2)); LIST_LENGTH=$((${#LIST[@]}/2));
#echo $LIST_LENGHT #echo $LIST_LENGTH
#exit #exit
if [ "$LIST_LENGHT" -eq 1 ]; then if [ "$LIST_LENGTH" -eq 1 ]; then
SCREEN_RESOLUTION=${SCREEN_RESOLUTION[0]} SCREEN_RESOLUTION=${SCREEN_RESOLUTION[0]}
else else
exec 3>&1 exec 3>&1
SCREEN_RESOLUTION=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \ SCREEN_RESOLUTION=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \
--title "Select video mode" --clear --menu "" $((6+${LIST_LENGHT})) 25 $((1+${LIST_LENGHT})) "${LIST[@]}" 2>&1 1>&3) --title "Select video mode" --clear --menu "" $((6+${LIST_LENGTH})) 25 $((1+${LIST_LENGTH})) "${LIST[@]}" 2>&1 1>&3)
exec 3>&- exec 3>&-
fi fi
...@@ -545,15 +545,15 @@ function get_h3modes () ...@@ -545,15 +545,15 @@ function get_h3modes ()
do do
LIST+=( "${i[0]//[[:blank:]]/}" "" ) LIST+=( "${i[0]//[[:blank:]]/}" "" )
done done
LIST_LENGHT=$((${#LIST[@]}/2)); LIST_LENGTH=$((${#LIST[@]}/2));
#echo $LIST_LENGHT #echo $LIST_LENGTH
#exit #exit
if [ "$LIST_LENGHT" -eq 1 ]; then if [ "$LIST_LENGTH" -eq 1 ]; then
SCREEN_RESOLUTION=${SCREEN_RESOLUTION[0]} SCREEN_RESOLUTION=${SCREEN_RESOLUTION[0]}
else else
exec 3>&1 exec 3>&1
SCREEN_RESOLUTION=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \ SCREEN_RESOLUTION=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \
--title "Select video mode" --clear --menu "" $((6+${LIST_LENGHT})) 25 $((1+${LIST_LENGHT})) "${LIST[@]}" 2>&1 1>&3) --title "Select video mode" --clear --menu "" $((6+${LIST_LENGTH})) 25 $((1+${LIST_LENGTH})) "${LIST[@]}" 2>&1 1>&3)
exec 3>&- exec 3>&-
fi fi
...@@ -577,9 +577,9 @@ function add_choose_user () ...@@ -577,9 +577,9 @@ function add_choose_user ()
do do
LIST+=( "${i[0]//[[:blank:]]/}" "" ) LIST+=( "${i[0]//[[:blank:]]/}" "" )
done done
LIST_LENGHT=$((${#LIST[@]}/2)); LIST_LENGTH=$((${#LIST[@]}/2));
if [ "$LIST_LENGHT" -eq 0 ]; then if [ "$LIST_LENGTH" -eq 0 ]; then
dialog --backtitle "$BACKTITLE" --title " Notice " --msgbox "\nWe didn't find any unprivileged user with sudo rights which is required to run this service.\ dialog --backtitle "$BACKTITLE" --title " Notice " --msgbox "\nWe didn't find any unprivileged user with sudo rights which is required to run this service.\
\n\nPress enter to create one!" 10 48 \n\nPress enter to create one!" 10 48
read -t 0 temp read -t 0 temp
...@@ -589,12 +589,12 @@ function add_choose_user () ...@@ -589,12 +589,12 @@ function add_choose_user ()
[ -z "$CHOSEN_USER" ] && return [ -z "$CHOSEN_USER" ] && return
echo "Trying to add user $CHOSEN_USER" echo "Trying to add user $CHOSEN_USER"
adduser $CHOSEN_USER || return adduser $CHOSEN_USER || return
elif [ "$LIST_LENGHT" -eq 1 ]; then elif [ "$LIST_LENGTH" -eq 1 ]; then
CHOSEN_USER=${USERS[0]} CHOSEN_USER=${USERS[0]}
else else
exec 3>&1 exec 3>&1
CHOSEN_USER=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \ CHOSEN_USER=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \
--title "Select unprivileged user" --clear --menu "" $((6+${LIST_LENGHT})) 40 15 "${LIST[@]}" 2>&1 1>&3) --title "Select unprivileged user" --clear --menu "" $((6+${LIST_LENGTH})) 40 15 "${LIST[@]}" 2>&1 1>&3)
exec 3>&- exec 3>&-
fi fi
......
...@@ -48,7 +48,7 @@ function initialize_lte () ...@@ -48,7 +48,7 @@ function initialize_lte ()
# Copyright (c) 2016 Stanislav Sinyagin <ssinyagin@k-open.com>. # Copyright (c) 2016 Stanislav Sinyagin <ssinyagin@k-open.com>.
# This content is published under Creative Commons Attribution 4.0 # This content is published under Creative Commons Attribution 4.0
# International (CC BY 4.0) lincense. # International (CC BY 4.0) license.
# Source repository: https://github.com/ssinyagin/wwan_udev_rules # Source repository: https://github.com/ssinyagin/wwan_udev_rules
if ! check_if_installed ppp then; then if ! check_if_installed ppp then; then
...@@ -333,7 +333,7 @@ function check_channels () ...@@ -333,7 +333,7 @@ function check_channels ()
# #
# edit ip address witing network manager # edit ip address within network manager
# #
function nm_ip_editor () function nm_ip_editor ()
{ {
...@@ -527,14 +527,14 @@ function get_wlan_interface () ...@@ -527,14 +527,14 @@ function get_wlan_interface ()
do do
LIST+=( "${i[0]//[[:blank:]]/}" "" ) LIST+=( "${i[0]//[[:blank:]]/}" "" )
done done
LIST_LENGHT=$((${#LIST[@]}/2)); LIST_LENGTH=$((${#LIST[@]}/2));
if [ "$LIST_LENGHT" -eq 1 ]; then if [ "$LIST_LENGTH" -eq 1 ]; then
WIRELESS_ADAPTER=${WLAN_INTERFACES[0]} WIRELESS_ADAPTER=${WLAN_INTERFACES[0]}
else else
exec 3>&1 exec 3>&1
WIRELESS_ADAPTER=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \ WIRELESS_ADAPTER=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \
--title "Select interface" --clear --menu "" $((6+${LIST_LENGHT})) 40 15 "${LIST[@]}" 2>&1 1>&3) --title "Select interface" --clear --menu "" $((6+${LIST_LENGTH})) 40 15 "${LIST[@]}" 2>&1 1>&3)
exec 3>&- exec 3>&-
fi fi
...@@ -558,15 +558,15 @@ function select_default_interface () ...@@ -558,15 +558,15 @@ function select_default_interface ()
local IPADDR=$(ip -4 addr show dev ${i[0]} | awk '/inet/ {print $2}' | cut -d'/' -f1) local IPADDR=$(ip -4 addr show dev ${i[0]} | awk '/inet/ {print $2}' | cut -d'/' -f1)
[[ $IPADDR != "172.24.1.1" ]] && LIST+=( "${i[0]//[[:blank:]]/}" "${IPADDR}" ) [[ $IPADDR != "172.24.1.1" ]] && LIST+=( "${i[0]//[[:blank:]]/}" "${IPADDR}" )
done done
LIST_LENGHT=$((${#LIST[@]}/2)); LIST_LENGTH=$((${#LIST[@]}/2));
if [ "$LIST_LENGHT" -eq 0 ]; then if [ "$LIST_LENGTH" -eq 0 ]; then
DEFAULT_ADAPTER="lo" DEFAULT_ADAPTER="lo"
elif [ "$LIST_LENGHT" -eq 1 ]; then elif [ "$LIST_LENGTH" -eq 1 ]; then
DEFAULT_ADAPTER=${ADAPTER[0]} DEFAULT_ADAPTER=${ADAPTER[0]}
else else
exec 3>&1 exec 3>&1
DEFAULT_ADAPTER=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \ DEFAULT_ADAPTER=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \
--title "Select default interface" --clear --menu "" $((6+${LIST_LENGHT})) 40 15 "${LIST[@]}" 2>&1 1>&3) --title "Select default interface" --clear --menu "" $((6+${LIST_LENGTH})) 40 15 "${LIST[@]}" 2>&1 1>&3)
exec 3>&- exec 3>&-
fi fi
...@@ -595,14 +595,14 @@ function connect_bt_interface () ...@@ -595,14 +595,14 @@ function connect_bt_interface ()
LIST+=( "$a" "$b") LIST+=( "$a" "$b")
done done
LIST_LENGHT=$((${#LIST[@]}/2)); LIST_LENGTH=$((${#LIST[@]}/2));
if [ "$LIST_LENGHT" -eq 0 ]; then if [ "$LIST_LENGTH" -eq 0 ]; then
BT_ADAPTER=${WLAN_INTERFACES[0]} BT_ADAPTER=${WLAN_INTERFACES[0]}
dialog --backtitle "$BACKTITLE" --title "Bluetooth" --msgbox "\nNo nearby Bluetooth devices were found!" 7 43 dialog --backtitle "$BACKTITLE" --title "Bluetooth" --msgbox "\nNo nearby Bluetooth devices were found!" 7 43
else else
exec 3>&1 exec 3>&1
BT_ADAPTER=$(dialog --backtitle "$BACKTITLE" --no-collapse --title "Select interface" \ BT_ADAPTER=$(dialog --backtitle "$BACKTITLE" --no-collapse --title "Select interface" \
--clear --menu "" $((6+${LIST_LENGHT})) 50 15 "${LIST[@]}" 2>&1 1>&3) --clear --menu "" $((6+${LIST_LENGTH})) 50 15 "${LIST[@]}" 2>&1 1>&3)
exec 3>&- exec 3>&-
if [[ $BT_ADAPTER != "" ]]; then if [[ $BT_ADAPTER != "" ]]; then
dialog --backtitle "$BACKTITLE" --title "Please wait" --infobox "\nConnecting to $BT_ADAPTER " 5 35 dialog --backtitle "$BACKTITLE" --title "Please wait" --infobox "\nConnecting to $BT_ADAPTER " 5 35
......
...@@ -198,7 +198,7 @@ function jobs () ...@@ -198,7 +198,7 @@ function jobs ()
# #
"Full"|"Mini" ) "Full"|"Mini" )
if ! is_package_manager_running; then if ! is_package_manager_running; then
debconf-apt-progress -- apt-get -y purge armbian-firmware* # workaround since pkg replace deesn't work properly debconf-apt-progress -- apt-get -y purge armbian-firmware* # workaround since pkg replace doesn't work properly
debconf-apt-progress -- apt-get -y install armbian-firmware$(echo -"${1,,}" | sed 's/-mini//') debconf-apt-progress -- apt-get -y install armbian-firmware$(echo -"${1,,}" | sed 's/-mini//')
fi fi
;; ;;
...@@ -254,7 +254,7 @@ function jobs () ...@@ -254,7 +254,7 @@ function jobs ()
SYSTEMDNET=$(service systemd-networkd status | grep -w active | grep -w running) SYSTEMDNET=$(service systemd-networkd status | grep -w active | grep -w running)
dialog --title " IP address assignment " --colors --backtitle "$BACKTITLE" --help-button --help-label "Cancel" \ dialog --title " IP address assignment " --colors --backtitle "$BACKTITLE" --help-button --help-label "Cancel" \
--yes-label "DHCP" --no-label "Static" --yesno \ --yes-label "DHCP" --no-label "Static" --yesno \
"\n\Z1DHCP:\Z0 automatic IP asignment by your router or DHCP server\n\n\Z1Static:\Z0 manually fixed IP address" 9 70 "\n\Z1DHCP:\Z0 automatic IP assignment by your router or DHCP server\n\n\Z1Static:\Z0 manually fixed IP address" 9 70
exitstatus=$?; exitstatus=$?;
# dynamic # dynamic
...@@ -305,7 +305,7 @@ function jobs () ...@@ -305,7 +305,7 @@ function jobs ()
;; ;;
# Toogle IPV6 # Toggle IPv6
# #
"IPV6" ) "IPV6" )
# #
...@@ -382,7 +382,7 @@ function jobs () ...@@ -382,7 +382,7 @@ function jobs ()
fi fi
exitstatus=$?; exitstatus=$?;
if [[ $exitstatus = 0 ]]; then if [[ $exitstatus = 0 ]]; then
dialog --backtitle "$BACKTITLE" --title " Please wait " --infobox "\nDisabling hotstop. Please wait!" 5 35 dialog --backtitle "$BACKTITLE" --title " Please wait " --infobox "\nDisabling hotspot. Please wait!" 5 35
sed -i "s/^DAEMON_CONF=.*/DAEMON_CONF=/" /etc/init.d/hostapd sed -i "s/^DAEMON_CONF=.*/DAEMON_CONF=/" /etc/init.d/hostapd
# disable DNS # disable DNS
systemctl daemon-reload systemctl daemon-reload
...@@ -607,7 +607,7 @@ function jobs () ...@@ -607,7 +607,7 @@ function jobs ()
# reload to connect # reload to connect
${VPNDIR}vpnclient stop >/dev/null 2>&1 ${VPNDIR}vpnclient stop >/dev/null 2>&1
${VPNDIR}vpnclient start >/dev/null 2>&1 ${VPNDIR}vpnclient start >/dev/null 2>&1
[[ $? = 0 ]] && dialog --backtitle "$BACKTITLE" --title " VPN " --msgbox "\nConfiguration was succesfully imported!" 7 43 [[ $? = 0 ]] && dialog --backtitle "$BACKTITLE" --title " VPN " --msgbox "\nConfiguration was successfully imported!" 7 43
fi fi
} }
...@@ -638,12 +638,12 @@ function jobs () ...@@ -638,12 +638,12 @@ function jobs ()
${VPNDIR}vpncmd /client localhost /cmd niccreate se >/dev/null 2>&1 ${VPNDIR}vpncmd /client localhost /cmd niccreate se >/dev/null 2>&1
fi fi
if [[ -z $(${VPNDIR}vpncmd /client localhost /cmd accountlist | grep "VPN Server") ]]; then if [[ -z $(${VPNDIR}vpncmd /client localhost /cmd accountlist | grep "VPN Server") ]]; then
dialog --backtitle "$BACKTITLE" --no-label " Cancel " --yes-label " Import " --title " VPN " --yesno "\nVPN configuration was not found.\n\nPlace file to /etc/server.vpn" 9 45 dialog --backtitle "$BACKTITLE" --no-label " Cancel " --yes-label " Import " --title " VPN " --yesno "\nA VPN configuration was not found.\n\nPlace valid file at /etc/server.vpn" 9 45
if [[ $? = 0 && -f /etc/server.vpn ]]; then if [[ $? = 0 && -f /etc/server.vpn ]]; then
${VPNDIR}vpncmd /client localhost /cmd accountimport //etc//server.vpn >/dev/null 2>&1 ${VPNDIR}vpncmd /client localhost /cmd accountimport //etc//server.vpn >/dev/null 2>&1
${VPNDIR}vpnclient stop >/dev/null 2>&1 ${VPNDIR}vpnclient stop >/dev/null 2>&1
${VPNDIR}vpnclient start >/dev/null 2>&1 ${VPNDIR}vpnclient start >/dev/null 2>&1
[[ $? = 0 ]] && dialog --backtitle "$BACKTITLE" --title " VPN " --msgbox "\nConfiguration was succesfully imported!" 7 43 [[ $? = 0 ]] && dialog --backtitle "$BACKTITLE" --title " VPN " --msgbox "\nConfiguration was successfully imported!" 7 43
fi fi
fi fi
...@@ -691,7 +691,7 @@ function jobs () ...@@ -691,7 +691,7 @@ function jobs ()
# Connect to Bluetooth # Connect to Bluetooth
# #
"BT discover" ) "BT discover" )
dialog --backtitle "$BACKTITLE" --title " Bluetooth " --msgbox "\nMake sure your Bluetooth devices are discoverable!" 7 54 dialog --backtitle "$BACKTITLE" --title " Bluetooth " --msgbox "\nVerify that your Bluetooth device is discoverable!" 7 54
connect_bt_interface connect_bt_interface
;; ;;
...@@ -1045,12 +1045,12 @@ function jobs () ...@@ -1045,12 +1045,12 @@ function jobs ()
(( j++ )) (( j++ ))
done < <(ls -1 ${OVERLAYDIR}/${overlay_prefix}*.dtbo | sed 's/^.*\('${overlay_prefix}'.*\)/\1/g' | sed 's/'${overlay_prefix}'-//g' | sed 's/.dtbo//g' ) done < <(ls -1 ${OVERLAYDIR}/${overlay_prefix}*.dtbo | sed 's/^.*\('${overlay_prefix}'.*\)/\1/g' | sed 's/'${overlay_prefix}'-//g' | sed 's/.dtbo//g' )
LISTLENGHT="$(($LIST_CONST+${#MOTD[@]}/2))" LISTLENGTH="$(($LIST_CONST+${#MOTD[@]}/2))"
exec 3>&1 exec 3>&1
selection=$(dialog --backtitle "$BACKTITLE" --colors --title "Toggle hardware configuration" --clear --cancel-label \ selection=$(dialog --backtitle "$BACKTITLE" --colors --title "Toggle hardware configuration" --clear --cancel-label \
"Back" --ok-label "Save" --checklist "\nUse \Z1<space>\Z0 to toggle functions and save them. Exit when you are done.\n " \ "Back" --ok-label "Save" --checklist "\nUse \Z1<space>\Z0 to toggle functions and save them. Exit when you are done.\n " \
$LISTLENGHT 80 $LISTLENGHT "${MOTD[@]}" 2>&1 1>&3) $LISTLENGTH 80 $LISTLENGTH "${MOTD[@]}" 2>&1 1>&3)
exit_status=$? exit_status=$?
exec 3>&- exec 3>&-
...@@ -1102,14 +1102,14 @@ function jobs () ...@@ -1102,14 +1102,14 @@ function jobs ()
DESC=$(description "${i[0]}") DESC=$(description "${i[0]}")
[[ "${i[0]}" != "$BEFORE" ]] && LIST+=( "${i[0]//[[:blank:]]/}" "$DESC" ) [[ "${i[0]}" != "$BEFORE" ]] && LIST+=( "${i[0]//[[:blank:]]/}" "$DESC" )
done done
LIST_LENGHT=$(($LIST_CONST+${#LIST[@]}/2)); LIST_LENGTH=$(($LIST_CONST+${#LIST[@]}/2));
if [ "$LIST_LENGHT" -le 3 ]; then if [ "$LIST_LENGTH" -le 3 ]; then
TARGET_MIRROR=${AVAL_MIRROR[0]} TARGET_MIRROR=${AVAL_MIRROR[0]}
dialog --backtitle "$BACKTITLE" --title "Please wait" --colors --msgbox "\nThere are no mirrors available!" 7 35 dialog --backtitle "$BACKTITLE" --title "Please wait" --colors --msgbox "\nThere are no mirrors available!" 7 35
else else
exec 3>&1 exec 3>&1
TARGET_MIRROR=$(dialog --cancel-label "Cancel" --backtitle "$BACKTITLE" --no-collapse \ TARGET_MIRROR=$(dialog --cancel-label "Cancel" --backtitle "$BACKTITLE" --no-collapse \
--title "Change repository location" --colors --clear --menu "\nfrom \Z1$BEFORE_DESC\Z0 to:\n " $((6+${LIST_LENGHT})) 60 15 "${LIST[@]}" 2>&1 1>&3) --title "Change repository location" --colors --clear --menu "\nfrom \Z1$BEFORE_DESC\Z0 to:\n " $((6+${LIST_LENGTH})) 60 15 "${LIST[@]}" 2>&1 1>&3)
exitstatus=$?; exitstatus=$?;
exec 3>&- exec 3>&-
fi fi
...@@ -1141,11 +1141,11 @@ function jobs () ...@@ -1141,11 +1141,11 @@ function jobs ()
(( j++ )) (( j++ ))
done < <(ls -1 $HOME) done < <(ls -1 $HOME)
LISTLENGHT="$(($LIST_CONST+${#MOTD[@]}/3))" LISTLENGTH="$(($LIST_CONST+${#MOTD[@]}/3))"
exec 3>&1 exec 3>&1
selection=$(dialog --backtitle "$BACKTITLE" --title "Toggle motd executing scripts" --clear --cancel-label \ selection=$(dialog --backtitle "$BACKTITLE" --title "Toggle motd executing scripts" --clear --cancel-label \
"Back" --ok-label "Save" --checklist "\nChoose what you want to enable or disable:\n " \ "Back" --ok-label "Save" --checklist "\nChoose what you want to enable or disable:\n " \
$LISTLENGHT 80 15 "${MOTD[@]}" 2>&1 1>&3) $LISTLENGTH 80 15 "${MOTD[@]}" 2>&1 1>&3)
exit_status=$? exit_status=$?
exec 3>&- exec 3>&-
case $exit_status in case $exit_status in
...@@ -1195,7 +1195,7 @@ function jobs () ...@@ -1195,7 +1195,7 @@ function jobs ()
MOTD+=( "PasswordAuthentication" "Password login" "$PasswordAuthentication" ) MOTD+=( "PasswordAuthentication" "Password login" "$PasswordAuthentication" )
MOTD+=( "PubkeyAuthentication" "SSH key login" "$PubkeyAuthentication" ) MOTD+=( "PubkeyAuthentication" "SSH key login" "$PubkeyAuthentication" )
MOTD+=( "PhoneAuthentication" "Mobile phone one-time passcode" "$PhoneAuthentication" ) MOTD+=( "PhoneAuthentication" "Mobile phone one-time passcode" "$PhoneAuthentication" )
LISTLENGHT="$(($LIST_CONST+${#MOTD[@]}/2))" LISTLENGTH="$(($LIST_CONST+${#MOTD[@]}/2))"
Buttons="--no-cancel --ok-label "Save" --help-button --help-label Cancel" Buttons="--no-cancel --ok-label "Save" --help-button --help-label Cancel"
if [[ $PhoneAuthentication == "on" ]]; then if [[ $PhoneAuthentication == "on" ]]; then
...@@ -1207,7 +1207,7 @@ function jobs () ...@@ -1207,7 +1207,7 @@ function jobs ()
exec 3>&1 exec 3>&1
selection=$(dialog $Buttons --backtitle "$BACKTITLE" --title " Toggle sshd options " --clear --checklist \ selection=$(dialog $Buttons --backtitle "$BACKTITLE" --title " Toggle sshd options " --clear --checklist \
"\nChoose what you want to enable or disable:\n " $LISTLENGHT 80 21 "${MOTD[@]}" 2>&1 1>&3) "\nChoose what you want to enable or disable:\n " $LISTLENGTH 80 21 "${MOTD[@]}" 2>&1 1>&3)
exit_status=$? exit_status=$?
exec 3>&- exec 3>&-
...@@ -1301,9 +1301,9 @@ function jobs () ...@@ -1301,9 +1301,9 @@ function jobs ()
"Nightly" ) "Nightly" )
if ! is_package_manager_running; then if ! is_package_manager_running; then
dialog --colors --title " \Z1Warning\Z0 " --backtitle "$BACKTITLE" --yes-label "OK" \ dialog --colors --title " \Z1Warning\Z0 " --backtitle "$BACKTITLE" --yes-label "Yes" \
--no-label "Cancel" --yesno \ --no-label "No" --yesno \
"\nYou are switching to untested auto-build repository which might break your system.\n\nAre you fine with that?" 10 48 "\nYou are switching to an untested auto-build repository which might break your system.\n\nContinue?" 10 48
if [[ $? = 0 ]]; then if [[ $? = 0 ]]; then
sed -i 's/apt.armbian.com/beta.armbian.com/' /etc/apt/sources.list.d/armbian.list sed -i 's/apt.armbian.com/beta.armbian.com/' /etc/apt/sources.list.d/armbian.list
...@@ -1318,9 +1318,9 @@ function jobs () ...@@ -1318,9 +1318,9 @@ function jobs ()
"Stable" ) "Stable" )
if ! is_package_manager_running; then if ! is_package_manager_running; then
dialog --colors --title " \Z1Warning\Z0 " --backtitle "$BACKTITLE" --yes-label "OK" \ dialog --colors --title " \Z1Warning\Z0 " --backtitle "$BACKTITLE" --yes-label "Yes" \
--no-label "Cancel" --yesno \ --no-label "No" --yesno \
"\nYou are switching back to stable respository where you are going to get future updates. Are you fine with that?" 9 44 "\nYou are switching to a stable repository where you will receive future updates.\n\nContinue?" 9 44
if [[ $? = 0 ]]; then if [[ $? = 0 ]]; then
sed -i 's/beta.armbian.com/apt.armbian.com/' /etc/apt/sources.list.d/armbian.list sed -i 's/beta.armbian.com/apt.armbian.com/' /etc/apt/sources.list.d/armbian.list
...@@ -1336,8 +1336,8 @@ function jobs () ...@@ -1336,8 +1336,8 @@ function jobs ()
if ! is_package_manager_running; then if ! is_package_manager_running; then
aval_dtbs aval_dtbs
if [[ $exitstatus = 0 ]]; then if [[ $exitstatus = 0 ]]; then
BOX_LENGHT=$((${#TARGET_BOARD}+28)); BOX_LENGTH=$((${#TARGET_BOARD}+28));
dialog --title "Switching board config" --backtitle "$BACKTITLE" --yes-label "Reboot" --no-label "Cancel" --yesno "\nReboot to $TARGET_BOARD settings?" 7 $BOX_LENGHT dialog --title "Switching board config" --backtitle "$BACKTITLE" --yes-label "Reboot" --no-label "Cancel" --yesno "\nReboot to $TARGET_BOARD settings?" 7 $BOX_LENGTH
if [[ $? = 0 ]]; then if [[ $? = 0 ]]; then
sed -i "s/^fdt_file=.*/fdt_file=$TARGET_BOARD/" /boot/armbianEnv.txt 2> /dev/null && grep -q "fdt_file=$TARGET_BOARD" /boot/armbianEnv.txt 2> /dev/null || echo "fdt_file=$TARGET_BOARD" >> /boot/armbianEnv.txt sed -i "s/^fdt_file=.*/fdt_file=$TARGET_BOARD/" /boot/armbianEnv.txt 2> /dev/null && grep -q "fdt_file=$TARGET_BOARD" /boot/armbianEnv.txt 2> /dev/null || echo "fdt_file=$TARGET_BOARD" >> /boot/armbianEnv.txt
[[ "$LINUXFAMILY" = odroidxu4 ]] && sed -i "s/^fdt_file/board_name/" /boot/armbianEnv.txt && sed -i "s/^BOARD_NAME.*/BOARD_NAME=\"Odroid ${TARGET_BOARD^^}\"/" /etc/armbian-release [[ "$LINUXFAMILY" = odroidxu4 ]] && sed -i "s/^fdt_file/board_name/" /boot/armbianEnv.txt && sed -i "s/^BOARD_NAME.*/BOARD_NAME=\"Odroid ${TARGET_BOARD^^}\"/" /etc/armbian-release
......
...@@ -31,7 +31,7 @@ while true; do ...@@ -31,7 +31,7 @@ while true; do
# check update status of BSP packages # check update status of BSP packages
local mark=$(apt-mark showhold | egrep "linux|armbian") local mark=$(apt-mark showhold | egrep "linux|armbian")
# check if install targets are avaliable # check if install targets are available
if [[ $(sed -n 's/^DEVNAME=//p' /sys/dev/block/$(mountpoint -d /)/uevent 2> /dev/null) == mmcblk* \ if [[ $(sed -n 's/^DEVNAME=//p' /sys/dev/block/$(mountpoint -d /)/uevent 2> /dev/null) == mmcblk* \
&& -f /usr/sbin/nand-sata-install ]]; then && -f /usr/sbin/nand-sata-install ]]; then
LIST+=( "Install" "Install to SATA, eMMC, NAND or USB" ) LIST+=( "Install" "Install to SATA, eMMC, NAND or USB" )
...@@ -111,9 +111,9 @@ while true; do ...@@ -111,9 +111,9 @@ while true; do
fi fi
fi fi
# count number of menu items to adjust window sizee # count number of menu items to adjust window size
LISTLENGHT="$((6+${#LIST[@]}/2))" LISTLENGTH="$((6+${#LIST[@]}/2))"
BOXLENGHT=${#LIST[@]} BOXLENGTH=${#LIST[@]}
temp_rc=$(mktemp) temp_rc=$(mktemp)
if [[ -n ${mark} || -n $(grep -w beta /etc/apt/sources.list.d/armbian.list 2> /dev/null) ]]; then if [[ -n ${mark} || -n $(grep -w beta /etc/apt/sources.list.d/armbian.list 2> /dev/null) ]]; then
cat <<-'EOF' > $temp_rc cat <<-'EOF' > $temp_rc
...@@ -135,7 +135,7 @@ while true; do ...@@ -135,7 +135,7 @@ while true; do
exec 3>&1 exec 3>&1
selection=$(DIALOGRC=$temp_rc dialog --colors --backtitle "$BACKTITLE" --title " $sys_title " --clear \ selection=$(DIALOGRC=$temp_rc dialog --colors --backtitle "$BACKTITLE" --title " $sys_title " --clear \
--cancel-label "Back" --menu "$disclaimer" $LISTLENGHT 68 $BOXLENGHT \ --cancel-label "Back" --menu "$disclaimer" $LISTLENGTH 68 $BOXLENGTH \
"${LIST[@]}" 2>&1 1>&3) "${LIST[@]}" 2>&1 1>&3)
exit_status=$? exit_status=$?
exec 3>&- exec 3>&-
...@@ -182,11 +182,11 @@ while true; do ...@@ -182,11 +182,11 @@ while true; do
fi fi
# toogle IPV6 # toggle IPv6
if [[ $(cat /proc/sys/net/ipv6/conf/all/disable_ipv6) == 1 ]]; then if [[ $(cat /proc/sys/net/ipv6/conf/all/disable_ipv6) == 1 ]]; then
LIST+=( "IPV6" "Enable IPV6 for APT and system" ) LIST+=( "IPV6" "Enable IPv6 for APT and system" )
else else
LIST+=( "IPV6" "Disable IPV6 for APT and system" ) LIST+=( "IPV6" "Disable IPv6 for APT and system" )
fi fi
# network throughput test # network throughput test
...@@ -229,9 +229,9 @@ while true; do ...@@ -229,9 +229,9 @@ while true; do
[[ $(ls -1 /etc/NetworkManager/system-connections 2> /dev/null) ]] && \ [[ $(ls -1 /etc/NetworkManager/system-connections 2> /dev/null) ]] && \
LIST+=( "Forget" "Disconnect and forget all wireless connections" ) LIST+=( "Forget" "Disconnect and forget all wireless connections" )
# count number of menu items to adjust window sizee # count number of menu items to adjust window size
LISTLENGHT="$((12+${#LIST[@]}/2))" LISTLENGTH="$((12+${#LIST[@]}/2))"
BOXLENGHT=${#LIST[@]} BOXLENGTH=${#LIST[@]}
WIFICONNECTED=$(LC_ALL=C nmcli -f NAME,TYPE connection show --active 2> /dev/null | grep wireless | awk 'NF{NF-=1};1') WIFICONNECTED=$(LC_ALL=C nmcli -f NAME,TYPE connection show --active 2> /dev/null | grep wireless | awk 'NF{NF-=1};1')
local disclaimer="" local disclaimer=""
...@@ -252,7 +252,7 @@ while true; do ...@@ -252,7 +252,7 @@ while true; do
disclaimer="$ifup" disclaimer="$ifup"
if [[ -n $WIFICONNECTED ]]; then if [[ -n $WIFICONNECTED ]]; then
LISTLENGHT=$((LISTLENGHT+2)) LISTLENGTH=$((LISTLENGTH+2))
local connected="\n\Z0Connected to SSID: \Z1${WIFICONNECTED}\n\Z0 " local connected="\n\Z0Connected to SSID: \Z1${WIFICONNECTED}\n\Z0 "
disclaimer=$disclaimer"$connected" disclaimer=$disclaimer"$connected"
fi fi
...@@ -260,11 +260,11 @@ while true; do ...@@ -260,11 +260,11 @@ while true; do
if [[ -n $VPNSERVERIP ]]; then if [[ -n $VPNSERVERIP ]]; then
local vpnserverip="\n\Z0Connected to VPN server: \Z1${VPNSERVERIP}\n\Z0 " local vpnserverip="\n\Z0Connected to VPN server: \Z1${VPNSERVERIP}\n\Z0 "
disclaimer=$disclaimer"$vpnserverip" disclaimer=$disclaimer"$vpnserverip"
LISTLENGHT=$((LISTLENGHT+2)) LISTLENGTH=$((LISTLENGTH+2))
fi fi
if [[ -n $HOSTAPDINFO && -n $HOSTAPDSTATUS ]]; then if [[ -n $HOSTAPDINFO && -n $HOSTAPDSTATUS ]]; then
LISTLENGHT=$((LISTLENGHT+2)) LISTLENGTH=$((LISTLENGTH+2))
chpid=$(dmesg | grep $(grep ^interface /etc/hostapd.conf | sed 's/interface=//g') | head -1 | sed 's/\[.*\]//g' | awk '{print $1}') chpid=$(dmesg | grep $(grep ^interface /etc/hostapd.conf | sed 's/interface=//g') | head -1 | sed 's/\[.*\]//g' | awk '{print $1}')
disclaimer=$disclaimer$"\n\Z0Hotspot SSID: \Z1$HOSTAPDINFO\Zn Band:"; disclaimer=$disclaimer$"\n\Z0Hotspot SSID: \Z1$HOSTAPDINFO\Zn Band:";
if [[ `grep ^hw_mode=a /etc/hostapd.conf` ]]; then local band="5Ghz"; else band="2.4Ghz"; fi if [[ `grep ^hw_mode=a /etc/hostapd.conf` ]]; then local band="5Ghz"; else band="2.4Ghz"; fi
...@@ -273,14 +273,14 @@ while true; do ...@@ -273,14 +273,14 @@ while true; do
disclaimer=$disclaimer$" \Z1${band} ${type}\Z0" disclaimer=$disclaimer$" \Z1${band} ${type}\Z0"
[[ ! "$chpid" =~ .*IPv6.* ]] && disclaimer=$disclaimer$"\n\nChip: \Z1${chpid}\Z0"; [[ ! "$chpid" =~ .*IPv6.* ]] && disclaimer=$disclaimer$"\n\nChip: \Z1${chpid}\Z0";
if [ "$HOSTAPDCLIENTS" -gt "0" ]; then disclaimer=$disclaimer$" Connected clients: \Z1$HOSTAPDCLIENTS\Zn"; fi if [ "$HOSTAPDCLIENTS" -gt "0" ]; then disclaimer=$disclaimer$" Connected clients: \Z1$HOSTAPDCLIENTS\Zn"; fi
if [[ ! "$chpid" =~ .*IPv6.* ]]; then LISTLENGHT=$((LISTLENGHT+2)); fi if [[ ! "$chpid" =~ .*IPv6.* ]]; then LISTLENGTH=$((LISTLENGTH+2)); fi
disclaimer=$disclaimer$"\n"; disclaimer=$disclaimer$"\n";
fi fi
disclaimer=$disclaimer"\n\Z1Note\Zn: This tool can be successful only when drivers are in good shape. If autodetection fails, you are on your own.\n " disclaimer=$disclaimer"\n\Z1Note\Zn: This tool can be successful only when drivers are configured properly. If auto-detection fails, you are on your own.\n "
exec 3>&1 exec 3>&1
selection=$(dialog --backtitle "$BACKTITLE" --colors --title " Wired, Wireless, Bluetooth, Hotspot " --clear \ selection=$(dialog --backtitle "$BACKTITLE" --colors --title " Wired, Wireless, Bluetooth, Hotspot " --clear \
--cancel-label "Back" --menu "${disclaimer}" $LISTLENGHT 70 $BOXLENGHT \ --cancel-label "Back" --menu "${disclaimer}" $LISTLENGTH 70 $BOXLENGTH \
"${LIST[@]}" 2>&1 1>&3) "${LIST[@]}" 2>&1 1>&3)
exit_status=$? exit_status=$?
exec 3>&- exec 3>&-
...@@ -311,12 +311,12 @@ while true; do ...@@ -311,12 +311,12 @@ while true; do
LIST+=( "Welcome" "Toggle welcome screen items" ) LIST+=( "Welcome" "Toggle welcome screen items" )
# count number of menu items to adjust window sizee # count number of menu items to adjust window sizee
LISTLENGHT="$((6+${#LIST[@]}/2))" LISTLENGTH="$((6+${#LIST[@]}/2))"
BOXLENGHT=${#LIST[@]} BOXLENGTH=${#LIST[@]}
exec 3>&1 exec 3>&1
selection=$(dialog --colors --backtitle "$BACKTITLE" --title "Personal settings" --clear \ selection=$(dialog --colors --backtitle "$BACKTITLE" --title "Personal settings" --clear \
--cancel-label "Back" --menu "$disclaimer" $LISTLENGHT 70 $BOXLENGHT \ --cancel-label "Back" --menu "$disclaimer" $LISTLENGTH 70 $BOXLENGTH \
"${LIST[@]}" 2>&1 1>&3) "${LIST[@]}" 2>&1 1>&3)
exit_status=$? exit_status=$?
exec 3>&- exec 3>&-
...@@ -389,12 +389,12 @@ while true; do ...@@ -389,12 +389,12 @@ while true; do
fi fi
# count number of menu items to adjust window sizee # count number of menu items to adjust window sizee
LISTLENGHT="$((6+${#LIST[@]}/2))" LISTLENGTH="$((6+${#LIST[@]}/2))"
BOXLENGHT=${#LIST[@]} BOXLENGTH=${#LIST[@]}
exec 3>&1 exec 3>&1
selection=$(dialog --backtitle "$BACKTITLE" --title "System and 3rd party software" --clear \ selection=$(dialog --backtitle "$BACKTITLE" --title "System and 3rd party software" --clear \
--cancel-label "Back" --menu "$disclaimer" $LISTLENGHT 70 $BOXLENGHT \ --cancel-label "Back" --menu "$disclaimer" $LISTLENGTH 70 $BOXLENGTH \
"${LIST[@]}" 2>&1 1>&3) "${LIST[@]}" 2>&1 1>&3)
exit_status=$? exit_status=$?
exec 3>&- exec 3>&-
......
#!/bin/bash #!/bin/bash
# #
# Copyright (c) 2017 Igor Pecovnik, igor.pecovnik@gma**.com # Copyright (c) 2017 Igor Pečovnik, igor.pecovnik@gma**.com
# #
# This file is licensed under the terms of the GNU General Public # This file is licensed under the terms of the GNU General Public
# License version 2. This program is licensed "as is" without any # License version 2. This program is licensed "as is" without any
...@@ -246,7 +246,7 @@ esac ...@@ -246,7 +246,7 @@ esac
function server_conf function server_conf
{ {
# #
# Add some reqired date for installation # Add some required date for installation
# #
if [[ "$(curl -s ipinfo.io/ip)" != "$serverIP" ]]; then if [[ "$(curl -s ipinfo.io/ip)" != "$serverIP" ]]; then
table="\Z2Application Protocol Port\n table="\Z2Application Protocol Port\n
...@@ -832,7 +832,7 @@ chmod +x /etc/cron.daily/seed-armbian-torrent ...@@ -832,7 +832,7 @@ chmod +x /etc/cron.daily/seed-armbian-torrent
install_hassio () install_hassio ()
{ {
# #
# Install Home assitant smart home suite hass.io # Install Home assistant smart home suite hass.io
# #
install_docker install_docker
...@@ -1109,11 +1109,11 @@ chmod 700 vpnclient ...@@ -1109,11 +1109,11 @@ chmod 700 vpnclient
install_DashNTP () install_DashNTP ()
{ {
# #
# Install DASH and ntp service # Install DASH and NTP service
# #
echo "dash dash/sh boolean false" | debconf-set-selections echo "dash dash/sh boolean false" | debconf-set-selections
dpkg-reconfigure -f noninteractive dash > /dev/null 2>&1 dpkg-reconfigure -f noninteractive dash > /dev/null 2>&1
install_packet "ntp ntpdate" "Install DASH and ntp service" install_packet "ntp ntpdate" "Install DASH and NTP service"
} }
...@@ -1197,7 +1197,7 @@ service postfix restart >> /dev/null ...@@ -1197,7 +1197,7 @@ service postfix restart >> /dev/null
install_Virus () install_Virus ()
{ {
# #
# Install Amavisd-new, SpamAssassin, And Clamav # Install Amavisd-new, SpamAssassin, And ClamAV
# #
packets="amavisd-new spamassassin clamav clamav-daemon unzip bzip2 arj p7zip unrar-free ripole rpm nomarch lzop \ packets="amavisd-new spamassassin clamav clamav-daemon unzip bzip2 arj p7zip unrar-free ripole rpm nomarch lzop \
cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl \ cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl \
...@@ -1619,7 +1619,7 @@ while true; do ...@@ -1619,7 +1619,7 @@ while true; do
# prepare menu items # prepare menu items
check_status check_status
LISTLENGHT="$((${#LIST[@]}/2))" LISTLENGTH="$((${#LIST[@]}/2))"
exec 3>&1 exec 3>&1
selection=$(dialog --backtitle "$BACKTITLE" --title "Installing to $family $distribution" --colors --clear --cancel-label \ selection=$(dialog --backtitle "$BACKTITLE" --title "Installing to $family $distribution" --colors --clear --cancel-label \
"Cancel" --ok-label "Install" --checklist "\nChoose what you want to install:\n " $LIST_CONST 71 18 "${LIST[@]}" 2>&1 1>&3) "Cancel" --ok-label "Install" --checklist "\nChoose what you want to install:\n " $LIST_CONST 71 18 "${LIST[@]}" 2>&1 1>&3)
...@@ -1632,10 +1632,10 @@ while true; do ...@@ -1632,10 +1632,10 @@ while true; do
;; ;;
esac esac
# cycle trought all install options # cycle through all install options
i=0 i=0
if ! is_package_manager_running; then if ! is_package_manager_running; then
while [ "$i" -lt "$LISTLENGHT" ]; do while [ "$i" -lt "$LISTLENGTH" ]; do
if [[ "$selection" == *Samba* && "$SAMBA_STATUS" != "on" ]]; then if [[ "$selection" == *Samba* && "$SAMBA_STATUS" != "on" ]]; then
install_samba install_samba
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment