Skip to content

Commit

Permalink
Merge pull request #867 from Fourdee/testing
Browse files Browse the repository at this point in the history
**v148**
(08/04/17)

---

**Changes / Improvements / Optimizations:**

DietPi-Config | WiFi: Country code is now also applied to cfg80211 module params (ieee80211_regdom=): https://github.com/Fourdee/DietPi/issues/838

DietPi-Config | Network NAS/Misc: Added option to delay boot, until a valid network connection is established: https://github.com/Fourdee/DietPi/issues/842

DietPi-Config | Audio > Sound Card: Added support for AudioPhonics I-Sabre-K2M (9018K2M): https://github.com/Fourdee/DietPi/issues/716

DietPi-Software | NTPD check/wait: Is now bypassed if no valid network connection is available. It will be checked again, before software installation: https://github.com/Fourdee/DietPi/issues/840

DietPi-Software | Tonido: Now available for installation. Lightweight alternative to NextCloud/Owncloud: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=6476#p6476

DietPi-Software | IceCast: Now available for installation. This is a Shoutcast streaming server, using DarkIce for audio input: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=6526#p6526

DietPi-Software | MotionEye: Now available for installation (RPi only). Web interface and surveillance for your RPi/USB camera. Mainly focused towards motion detection usage: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&start=100

DietPi-Software | CloudPrint (Google): Now available for installation. Print server with support for Google cloud printing. Many thanks to Sciamano for his assistance with testing: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&start=100#p6630

DietPi-Set_Hardware | RPi Camera: Now enables bcm2835-v4l2 by default. Required for /dev/video0 stream (mainly for motioneye).

General | Boot: All failed drive mounts will be re-mounted after network connection is established. This is mainly a failsafe for CIFS/net shares, to ensure they are mounted again after network established: https://github.com/Fourdee/DietPi/issues/842#issuecomment-289448261

---

**Bug fixes:**

DietPi-Software | YaCy: Web interface admin details are now set during install. Username = admin, password = dietpi. Many thanks to Pilovali for reporting this!:

DietPi-Software | Gogs: Installation now resolved. Due to https://dl.gogs.io/ removing "latest" links for binary download. Now hosted on dietpi.com: https://github.com/Fourdee/DietPi/issues/833

DietPi-Software | OMV: Has been disabled. We have recieved too many reports from users with issues, due to incompatibility with DietPi. As we cant control what OMV does and how it does it, we cannot support it: https://github.com/Fourdee/DietPi/issues/851

DietPi-RAMlog | PiHole: Resolved an issue where PiHole logs were being cleared every 1 hour, if default locale on system is not en_GB. PiHole logs allow for current day and 5MB size limit. Many thanks to @k-plan for his assistance with this one: https://github.com/Fourdee/DietPi/issues/839

General | Cron-Daily: Removed a df export left over from auto TRIM code (no longer used).

General | RoseapplePi CPU temp: Now functional. Many thanks to @joaofl for this fix: https://github.com/Fourdee/DietPi/issues/848

---

**RPi Stretch:**

DietPi-Software | FFmpeg now sucessfully installs: https://github.com/Fourdee/DietPi/issues/475
  • Loading branch information
Fourdee authored Apr 8, 2017
2 parents 37c0353 + 87c4894 commit cafc878
Show file tree
Hide file tree
Showing 18 changed files with 767 additions and 117 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
v148
(08/04/17)

Changes / Improvements / Optimizations:
DietPi-Config | WiFi: Country code is now also applied to cfg80211 module params (ieee80211_regdom=): https://github.com/Fourdee/DietPi/issues/838
DietPi-Config | Network NAS/Misc: Added option to delay boot, until a valid network connection is established: https://github.com/Fourdee/DietPi/issues/842
DietPi-Config | Audio > Sound Card: Added support for AudioPhonics I-Sabre-K2M (9018K2M): https://github.com/Fourdee/DietPi/issues/716
DietPi-Software | NTPD check/wait: Is now bypassed if no valid network connection is available. It will be checked again, before software installation: https://github.com/Fourdee/DietPi/issues/840
DietPi-Software | Tonido: Now available for installation. Lightweight alternative to NextCloud/Owncloud: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=6476#p6476
DietPi-Software | IceCast: Now available for installation. This is a Shoutcast streaming server, using DarkIce for audio input: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=6526#p6526
DietPi-Software | MotionEye: Now available for installation (RPi only). Web interface and surveillance for your RPi/USB camera. Mainly focused towards motion detection usage: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&start=100
DietPi-Software | CloudPrint (Google): Now available for installation. Print server with support for Google cloud printing. Many thanks to Sciamano for his assistance with testing: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&start=100#p6630
DietPi-Set_Hardware | RPi Camera: Now enables bcm2835-v4l2 by default. Required for /dev/video0 stream (mainly for motioneye).
General | Boot: All failed drive mounts will be re-mounted after network connection is established. This is mainly a failsafe for CIFS/net shares, to ensure they are mounted again after network established: https://github.com/Fourdee/DietPi/issues/842#issuecomment-289448261

Bug fixes:
DietPi-Software | YaCy: Web interface admin details are now set during install. Username = admin, password = dietpi. Many thanks to Pilovali for reporting this!:
DietPi-Software | Gogs: Installation now resolved. Due to https://dl.gogs.io/ removing "latest" links for binary download. Now hosted on dietpi.com: https://github.com/Fourdee/DietPi/issues/833
DietPi-Software | OMV: Has been disabled. We have recieved too many reports from users with issues, due to incompatibility with DietPi. As we cant control what OMV does and how it does it, we cannot support it: https://github.com/Fourdee/DietPi/issues/851
DietPi-RAMlog | PiHole: Resolved an issue where PiHole logs were being cleared every 1 hour, if default locale on system is not en_GB. PiHole logs allow for current day and 5MB size limit. Many thanks to @k-plan for his assistance with this one: https://github.com/Fourdee/DietPi/issues/839
General | Cron-Daily: Removed a df export left over from auto TRIM code (no longer used).
General | RoseapplePi CPU temp: Now functional. Many thanks to @joaofl for this fix: https://github.com/Fourdee/DietPi/issues/848

RPi Stretch:
DietPi-Software | FFmpeg now sucessfully installs: https://github.com/Fourdee/DietPi/issues/475

-----------------------------------------------------------------------------------------------------------

v147
(24/03/17)

Expand Down
8 changes: 7 additions & 1 deletion PREP_SYSTEM_FOR_DIETPI.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,17 @@ apt-get purge -y gpsd ppp libboost-iostreams* sgml-base xml-core usb-modeswitch*

#+Desktop images (Mostly desktop packages, but apply to non-desktop images also):
apt-get purge -y libpod-* libpeas-* isc-dhcp-server gnome-* fonts-dejavu* eject dnsmasq* dns-root-data colord-data libturbojpeg1 libjasper* libjson* libwbclient* libwayland* golang-* libavahi* libtext* libweb* libpcsclite1 libxau6* libvpx1 libxc* dictionaries-* libgtk* miscfiles minicom lrzsz lxmenu-* x11-* zenity* yelp-*

rm -R /usr/share/fonts/*
rm -R /usr/share/icons/*


#+armbian
apt-get purge -y toilet toilet-fonts w-scan vlan weather-util* sysbench stress apt-transport-* cmake cmake-data device-tree-co* fping hddtemp haveged hostapd i2c-tools iperf ir-keytable libasound2* libmtp* libusb-dev lirc lsof ncurses-term pkg-config unicode-data rfkill pv mtp-tools m4 screen alsa-utils autotools-dev bind9-host btrfs-tools bridge-utils cpufrequtils dvb-apps dtv-scan-table* evtest f3 figlet gcc gcc-4.8-* git git-man iozone3 ifenslave
apt-get purge -y expect tcl-expect toilet toilet-fonts w-scan vlan weather-util* sysbench stress cmake cmake-data device-tree-co* fping hddtemp haveged hostapd i2c-tools iperf ir-keytable libasound2* libmtp* libusb-dev lirc lsof ncurses-term pkg-config unicode-data rfkill pv mtp-tools m4 screen alsa-utils autotools-dev bind9-host btrfs-tools bridge-utils cpufrequtils dvb-apps dtv-scan-table* evtest f3 figlet gcc gcc-4.8-* git git-man iozone3 ifenslave
#apt-get purge -y linux-jessie-root-*

#+ dev packages
# On ARMbian DEV branch images, manually do this as triggers '*-dev' image/uboot etc
apt-get purge -y '\-dev$' linux-headers*

#??? RPI
Expand Down Expand Up @@ -161,6 +163,7 @@ systemctl disable log2ram.service
rm /usr/local/sbin/log2ram
rm /etc/systemd/system/log2ram.service
systemctl daemon-reload
rm /etc/cron.hourly/log2ram

rm /etc/init.d/cpu_governor # Meveric
rm /etc/systemd/system/cpu_governor.service # Meveric
Expand All @@ -169,6 +172,9 @@ rm /etc/systemd/system/cpu_governor.service # Meveric
systemctl disable resize2fs
rm /etc/systemd/system/resize2fs.service

# ARMbian-config
rm /etc/profile.d/check_first_login_reboot.sh

#Set UID bit for sudo: https://github.com/Fourdee/DietPi/issues/794
chmod 4755 /usr/bin/sudo

Expand Down
3 changes: 3 additions & 0 deletions dietpi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ proxy_port=8080
proxy_username=
proxy_password=

#Delay boot until network is established: 0=disabled | 1=10 second wait max (default) | 2=infinite wait
boot_wait_for_network=1

#DietPi check for updates (allows dietpi to check for updates on a daily basis and boot using a <1kb file download.)
dietpi_check_for_updates=1

Expand Down
2 changes: 1 addition & 1 deletion dietpi/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
147
148
33 changes: 28 additions & 5 deletions dietpi/boot
Original file line number Diff line number Diff line change
Expand Up @@ -235,25 +235,48 @@ _EOF_
Wait_For_Valid_Network_Connection(){

#Attempt to wait for a valid network connection
local max_loops=10
local max_loops=1

# Wait mode, max time
local boot_wait_for_network=$(cat /DietPi/dietpi.txt | grep -m1 '^boot_wait_for_network=' | sed 's/.*=//')
if (( $boot_wait_for_network == 1 )); then

max_loops=10

fi

local loop_count=0
while true
do

if (( $loop_count >= $max_loops )); then
echo -e "$(date) | Valid connection wait timed out." >> "$FP_LOGFILE"

/DietPi/dietpi/func/dietpi-notify 1 "$(date) | Valid connection wait timed out." | tee -a "$FP_LOGFILE"
break

elif (( ! $(route | awk '{print $4}' | grep -ci -m1 'UG') )); then
echo -e "$(date) | Waiting for valid connection." >> "$FP_LOGFILE"

/DietPi/dietpi/func/dietpi-notify 2 "$(date) | Waiting for valid connection, before continuing boot | Mode=$boot_wait_for_network" | tee -a "$FP_LOGFILE"
sleep 1

else

# - Update network details (for IP in dietpi-banner etc..)
echo -e "$(date) | Valid connection found." >> "$FP_LOGFILE"
/DietPi/dietpi/func/dietpi-notify 0 "$(date) | Valid connection found." | tee -a "$FP_LOGFILE"
/DietPi/dietpi/func/obtain_network_details

# Mount all drives again (eg: network shares)
mount -a

break

fi

((loop_count++))
if (( $boot_wait_for_network != 2 )); then

((loop_count++))

fi

done

Expand Down
17 changes: 1 addition & 16 deletions dietpi/conf/cron.daily_dietpi
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,7 @@
#----------------------------------------------------------------
# Main Loop
#----------------------------------------------------------------
#TRIM drives (all mount points)
df -P | awk '{print $6}' | tail -n +2 > /tmp/.dietpi-cron-daily_trim

## Sync filesystem and save all outstanding changes to disk.
# sync

# echo -e "\n$(date)\nDietPi Cron Daily | Filesystem trim" >> /var/log/dietpi_cron_daily_trim.log
# while read -r line
# do
# fstrim -v "$line" >> /var/log/dietpi_cron_daily_trim.log

# done < /tmp/.dietpi-cron-daily_trim
# rm /tmp/.dietpi-cron-daily_trim

# sync

#TRIM drives (all mount points) | Removed due to instability on some systems = corruptions.
#----------------------------------------------------------------
#Update NTP
if (( $NTPD_UPDATE_MODE == 2 )); then
Expand Down
3 changes: 3 additions & 0 deletions dietpi/dietpi-bugreport
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ _EOF_
"ls -lha /var/log"
"dpkg -l"
"ifconfig -a"
"iwconfig"
"ip a"
"lsusb"
"cat /proc/cpuinfo"
Expand All @@ -167,6 +168,8 @@ _EOF_
"cut -d: -f1 /etc/passwd"
"locale"
"ls -lha /mnt" #dietpi userdata location
"dmesg"
"lsmod"

)

Expand Down
146 changes: 107 additions & 39 deletions dietpi/dietpi-config
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
HW_CPUID=$(sed -n 9p /DietPi/dietpi/.hw_model)
HW_ONBOARD_WIFI=$(sed -n 10p /DietPi/dietpi/.hw_model)

FP_CPU_SCALING_GOV='/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors'

#/////////////////////////////////////////////////////////////////////////////////////
#Obtain Install Stage Index
#/////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1122,8 +1124,22 @@

#All devices
local current_cpu_governor=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_governor=' | sed 's/.*=//')
local frequency_min_cpu_governor=$(( $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq) / 1000 ))
local frequency_max_cpu_governor=$(( $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq) / 1000 ))

local frequency_min_cpu_governor=1
local fp_frequency_min_cpu_governor='/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'
if [ -f "$fp_frequency_min_cpu_governor" ]; then

frequency_min_cpu_governor=$(( $(cat "$fp_frequency_min_cpu_governor") / 1000 ))

fi

local frequency_max_cpu_governor=2
local fp_frequency_max_cpu_governor='/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq'
if [ -f "$fp_frequency_max_cpu_governor" ]; then

frequency_max_cpu_governor=$(( $(cat "$fp_frequency_max_cpu_governor") / 1000 ))

fi

local arm_temp=$(/DietPi/dietpi/dietpi-cpuinfo 1)
if [[ $arm_temp =~ ^-?[0-9]+$ ]]; then
Expand Down Expand Up @@ -1334,49 +1350,59 @@
;;
"Change CPU Governor"*)

#Obtain available Govs. Setup their menu and description.
local Description="Change CPU Governor:"
local whiptail_menu_array=()
if (( $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | grep -ci -m1 'interactive') == 1 )); then
whiptail_menu_array+=("interactive" "Scales CPU frequency between $frequency_min_cpu_governor MHz and $frequency_max_cpu_governor MHz.")
Description+="\nInteractive | Dynamic CPU frequency based on usage (recommended)"
fi
# - Scaling govs not available
if [ ! -f "$FP_CPU_SCALING_GOV" ]; then

# - C1 | disable ondemand: https://github.com/Fourdee/DietPi/issues/248
if (( $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | grep -ci -m1 'ondemand') == 1 )) &&
(( $HW_MODEL != 10 )); then
whiptail_menu_array+=("ondemand" "Scales CPU frequency between $frequency_min_cpu_governor MHz and $frequency_max_cpu_governor MHz.")
Description+="\nOndemand | Dynamic CPU frequency based on usage."
fi
whiptail --title "Not Available" --msgbox "Your processor, or kernel, does not support this feature.\n\n(Info): scaling_available_governors does not exist." --backtitle "$WHIP_BACKTITLE" 10 65

if (( $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | grep -ci -m1 'conservative') == 1 )); then
whiptail_menu_array+=("conservative" "Scales CPU frequency between $frequency_min_cpu_governor MHz and $frequency_max_cpu_governor MHz.")
Description+="\nConservative | Same as ondemand. Bias towards powersaving, slower scaling. "
fi
# - Obtain available Govs. Setup their menu and description.
else

if (( $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | grep -ci -m1 'powersave') == 1 )); then
whiptail_menu_array+=("powersave" "Limits CPU frequency to $frequency_min_cpu_governor MHz.")
Description+="\nPowersave | Static. Reduces energy consumption, heat, performance."
fi
local Description="Change CPU Governor:"
local whiptail_menu_array=()
if (( $(cat "$FP_CPU_SCALING_GOV" | grep -ci -m1 'interactive') == 1 )); then
whiptail_menu_array+=("interactive" "Scales CPU frequency between $frequency_min_cpu_governor MHz and $frequency_max_cpu_governor MHz.")
Description+="\nInteractive | Dynamic CPU frequency based on usage (recommended)"
fi

if (( $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | grep -ci -m1 'performance') == 1 )); then
whiptail_menu_array+=("performance" "Forces CPU frequency to $frequency_max_cpu_governor MHz.")
Description+="\nPerformance | Static. Increases energy consumption, heat, performance."
fi
# - C1 | disable ondemand: https://github.com/Fourdee/DietPi/issues/248
if (( $(cat "$FP_CPU_SCALING_GOV" | grep -ci -m1 'ondemand') == 1 )) &&
(( $HW_MODEL != 10 )); then
whiptail_menu_array+=("ondemand" "Scales CPU frequency between $frequency_min_cpu_governor MHz and $frequency_max_cpu_governor MHz.")
Description+="\nOndemand | Dynamic CPU frequency based on usage."
fi

OPTION=$(whiptail --title "$WHIP_TITLE" --menu "$Description" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" --default-item "$current_cpu_governor" 18 80 5 "${whiptail_menu_array[@]}" 3>&1 1>&2 2>&3)
CHOICE=$?
if (( $(cat "$FP_CPU_SCALING_GOV" | grep -ci -m1 'conservative') == 1 )); then
whiptail_menu_array+=("conservative" "Scales CPU frequency between $frequency_min_cpu_governor MHz and $frequency_max_cpu_governor MHz.")
Description+="\nConservative | Same as ondemand. Bias towards powersaving, slower scaling. "
fi

#delete[] array
unset whiptail_menu_array
if (( $(cat "$FP_CPU_SCALING_GOV" | grep -ci -m1 'powersave') == 1 )); then
whiptail_menu_array+=("powersave" "Limits CPU frequency to $frequency_min_cpu_governor MHz.")
Description+="\nPowersave | Static. Reduces energy consumption, heat, performance."
fi

if (( $(cat "$FP_CPU_SCALING_GOV" | grep -ci -m1 'performance') == 1 )); then
whiptail_menu_array+=("performance" "Forces CPU frequency to $frequency_max_cpu_governor MHz.")
Description+="\nPerformance | Static. Increases energy consumption, heat, performance."
fi

OPTION=$(whiptail --title "$WHIP_TITLE" --menu "$Description" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" --default-item "$current_cpu_governor" 18 80 5 "${whiptail_menu_array[@]}" 3>&1 1>&2 2>&3)
CHOICE=$?

#delete[] array
unset whiptail_menu_array

if (( $CHOICE == 0 )); then
sed -i "/cpu_governor=/c\cpu_governor=$OPTION" /DietPi/dietpi.txt
/DietPi/dietpi/dietpi-cpu_set
fi

if (( $CHOICE == 0 )); then
sed -i "/cpu_governor=/c\cpu_governor=$OPTION" /DietPi/dietpi.txt
/DietPi/dietpi/dietpi-cpu_set
fi

#Return to This Menu
TARGETMENUID=4

;;
"CPU Throttle Up"*)
MIN_VALUE=30
Expand Down Expand Up @@ -3610,8 +3636,6 @@ _EOF_
whiptail_menu_array+=("rpi-bcm2835-3.5mm" "Onboard: 3.5mm forced output")
whiptail_menu_array+=("rpi-bcm2835-ultrahq" "Onboard HQ: HDMI (if plugged in, else 3.5mm)")
whiptail_menu_array+=("rpi-bcm2835-ultrahq-3.5mm" "Onboard HQ: 3.5mm forced output")
whiptail_menu_array+=("justboom-dac" "JustBoom: DAC HAT, Amp HAT, DAC Zero and Amp Zero")
whiptail_menu_array+=("justboom-digi" "JustBoom: Digi HAT and Digi Zero")
whiptail_menu_array+=("allo-boss-dac-pcm512x-audio" "Allo Boss DAC")
whiptail_menu_array+=("allo-piano-dac-pcm512x-audio" "Allo Piano DAC")
whiptail_menu_array+=("allo-piano-dac-plus-pcm512x-audio" "Allo Piano DAC 2.1")
Expand All @@ -3620,13 +3644,15 @@ _EOF_
whiptail_menu_array+=("hifiberry-dacplus" "HifiBerry DAC+")
whiptail_menu_array+=("hifiberry-digi" "HifiBerry DIGI / DIGI+")
whiptail_menu_array+=("hifiberry-digi-pro" "HifiBerry DIGI Pro")
whiptail_menu_array+=("i-sabre-k2m" "AudioPhonics I-Sabre-K2M (9018K2M)")
whiptail_menu_array+=("iqaudio-dacplus" "Pi-DAC+, Pi-DACZero, Pi-DAC Pro, Pi-DigiAMP+")
whiptail_menu_array+=("iqaudio-digi-wm8804-audio" "Pi-DIGI+")
whiptail_menu_array+=("iqaudio-dacplus,auto_mute_amp" "Pi-DigiAMP+")
whiptail_menu_array+=("iqaudio-dacplus,unmute_amp" "Pi-DigiAMP+")
whiptail_menu_array+=("justboom-dac" "JustBoom: DAC HAT, Amp HAT, DAC Zero and Amp Zero")
whiptail_menu_array+=("justboom-digi" "JustBoom: Digi HAT and Digi Zero")
whiptail_menu_array+=("rpi-dac" "Soekris DAM1021 (pcm1794a)")


# - C1/C2
elif (( $HW_MODEL == 10 || $HW_MODEL == 12 )); then

Expand Down Expand Up @@ -3979,18 +4005,60 @@ _EOF_

fi

#Network boot wait
local boot_wait_for_network=$(cat /DietPi/dietpi.txt | grep -m1 '^boot_wait_for_network=' | sed 's/.*=//')
local boot_wait_for_network_text=': '
if (( $boot_wait_for_network == 0 )); then

boot_wait_for_network_text+='Disabled'

elif (( $boot_wait_for_network == 1 )); then

boot_wait_for_network_text+='10 Seconds MAX (default)'

elif (( $boot_wait_for_network == 2 )); then

boot_wait_for_network_text+='Infinite wait'
fi

WHIP_TITLE='DietPi - Network Options: NAS/Misc'
OPTION=$(whiptail --title "$WHIP_TITLE" --menu "\n Apt mirror : $apt_mirror_current\n Samba client : $sambaclient_status\n FTP client : $curlftpfs_status\n NFS client : $nfsclient_status\n NoIp status : $noip_status" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 18 100 5 \
OPTION=$(whiptail --title "$WHIP_TITLE" --menu "\n Apt mirror : $apt_mirror_current\n Samba client : $sambaclient_status\n FTP client : $curlftpfs_status\n NFS client : $nfsclient_status\n NoIp status : $noip_status" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 19 100 6 \
"Apt Mirror" "Select a different Apt mirror for sources.list" \
"Samba Client" "$sambaclient_menutext" \
"FTP Client" "$curlftpfs_menutext" \
"NFS Client" "$nfsclient_menutext" \
"NoIp" "$noip_menutext" 3>&1 1>&2 2>&3)
"NoIp" "$noip_menutext" \
"Boot Net Wait" "$boot_wait_for_network_text" 3>&1 1>&2 2>&3)

CHOICE=$?
if (( $CHOICE == 0 )); then
case "$OPTION" in

"Boot Net Wait")

#Create Menu List for Whiptail
local whiptail_menu_array=()

whiptail_menu_array+=('0' ': Disabled')
whiptail_menu_array+=('1' ': Wait 10 Seconds MAX for network, before continuing boot (default)')
whiptail_menu_array+=('2' ': Infinite wait for network, before continuing boot')

OPTION=$(whiptail --title "Wait for network during boot" --menu "The following options will allow you to delay boot, until a valid network connection is available:" --default-item "$boot_wait_for_network" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 12 80 3 "${whiptail_menu_array[@]}" 3>&1 1>&2 2>&3)
CHOICE=$?
if (( $CHOICE == 0 )); then

sed -i "/^boot_wait_for_network=/c boot_wait_for_network=$OPTION" /DietPi/dietpi.txt

#Return to this Menu
TARGETMENUID=16

fi

#delete []
unset whiptail_menu_array

;;

"Apt Mirror")

#Create Menu List for Whiptail
Expand Down
Loading

0 comments on commit cafc878

Please sign in to comment.