From 87faca8819a2e0b1b36a7c09d869c21316374212 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 8 Feb 2019 20:15:53 +0000 Subject: [PATCH 001/232] v6.22 + VC's --- CHANGELOG.txt | 44 +++++++++++++++++++++-------------------- dietpi/.version | 2 +- dietpi/patch_file | 6 ++++++ dietpi/server_version-6 | 4 ++-- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 64d4cd2730..1c5f3c7a9f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,18 +1,10 @@ -v6.21 (Hotfix) -(07/02/19) +v6.22 +(xx/02/19) Changes / Improvements / Optimisations: -- DietPi-Software | VNC4: Automated VNC password based on $GLOBAL_PW. -- DietPi-Software | GPU memory split: You will now be prompted to increase GPU memory if DietPi detects a higher value is required for installed software: https://github.com/Fourdee/DietPi/issues/2483 Bug Fixes: -- General | G_RUN_CMD: Resolved issue with incorrect exit code return. This also prevented the ability to remove networked drives from dietpi-drive_manager: https://github.com/Fourdee/DietPi/issues/2508 -- General | Resolved an issue when updating to v6.20, where DietPi-RAMdisk failed to sync changes to disk, causing several issues after reboot: https://github.com/Fourdee/DietPi/issues/2471#issuecomment-460104856 -- DietPi-Software | WireGuard: Server installation also sets port as configured during installation to wg0-client.conf. Disabled installation for ARMv6 (no binaries). Many thanks to @WilburWalsh for reporting this issue: https://github.com/Fourdee/DietPi/issues/2474 -- DietPi-Software | VNCserver: Resolved "HOME" variable not set in service. -- DietPi-Software | MariaDB: Resolved an issue with latest MariaDB v10.3 update on Buster due to deprecated/removed settings: https://github.com/Fourdee/DietPi/pull/2490 -- PREP | Resolved issues with failed installation, due to missing pre-req directory: https://github.com/Fourdee/DietPi/issues/2487 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster @@ -30,6 +22,27 @@ For all additional issues that may appear after release, please see the followin ----------------------------------------------------------------------------------------------------------- +v6.21 (Hotfix) +(07/02/19) + +Changes / Improvements / Optimisations: +- DietPi-Software | VNC4: Automated VNC password based on $GLOBAL_PW. +- DietPi-Software | GPU memory split: You will now be prompted to increase GPU memory if DietPi detects a higher value is required for installed software: https://github.com/Fourdee/DietPi/issues/2483 + +Bug Fixes: +- General | G_RUN_CMD: Resolved issue with incorrect exit code return. This also prevented the ability to remove networked drives from dietpi-drive_manager: https://github.com/Fourdee/DietPi/issues/2508 +- General | Resolved an issue when updating to v6.20, where DietPi-RAMdisk failed to sync changes to disk, causing several issues after reboot: https://github.com/Fourdee/DietPi/issues/2471#issuecomment-460104856 +- DietPi-Software | WireGuard: Server installation also sets port as configured during installation to wg0-client.conf. Disabled installation for ARMv6 (no binaries). Many thanks to @WilburWalsh for reporting this issue: https://github.com/Fourdee/DietPi/issues/2474 +- DietPi-Software | VNCserver: Resolved "HOME" variable not set in service. +- DietPi-Software | MariaDB: Resolved an issue with latest MariaDB v10.3 update on Buster due to deprecated/removed settings: https://github.com/Fourdee/DietPi/pull/2490 +- PREP | Resolved issues with failed installation, due to missing pre-req directory: https://github.com/Fourdee/DietPi/issues/2487 + +As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster + +For all additional issues that may appear after release, please see the following link and select the 'Next Version Milestone' to see active tickets: https://github.com/Fourdee/DietPi/milestones + +----------------------------------------------------------------------------------------------------------- + v6.20 (28/01/19) @@ -139,8 +152,6 @@ Allo GUI: As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster -Known/Outstanding Core Issues: - ----------------------------------------------------------------------------------------------------------- v6.18 @@ -198,8 +209,6 @@ Bug Fixes: As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster -Known/Outstanding Core Issues: - ----------------------------------------------------------------------------------------------------------- v6.17 @@ -254,13 +263,6 @@ Allo GUI v11: As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster -Known/Outstanding Core Issues: -- O!MPD and MyMPD fail to update libaries. YMPD is fine: https://github.com/Fourdee/DietPi/issues/2156 -- Kodi shutdown options missing: https://github.com/Fourdee/DietPi/issues/2155 -- DietPi-Config | RPi | OpenGL/VC4 causes soundcard selection to be invalid: https://github.com/Fourdee/DietPi/issues/2173 -- PineA64: No sound over 3.5mm jack: https://github.com/Fourdee/DietPi/issues/2153 -- For all additional issues that may appear after release, please see the following link and select the 'Next Version Milestone' to see active tickets: https://github.com/Fourdee/DietPi/milestones - ----------------------------------------------------------------------------------------------------------- v6.16 diff --git a/dietpi/.version b/dietpi/.version index 4ac699de82..46b255593b 100644 --- a/dietpi/.version +++ b/dietpi/.version @@ -1,6 +1,6 @@ #!/bin/bash G_DIETPI_VERSION_CORE=6 -G_DIETPI_VERSION_SUB=21 +G_DIETPI_VERSION_SUB=22 G_DIETPI_VERSION_RC=0 G_GITBRANCH='master' G_GITOWNER='Fourdee' diff --git a/dietpi/patch_file b/dietpi/patch_file index 171c4723e8..850fd128e2 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1644,6 +1644,12 @@ Also have a look at "Sonarr", another alternative TV show manager, available for fi #------------------------------------------------------------------------------- + elif (( $G_DIETPI_VERSION_SUB == 21 )); then + + #------------------------------------------------------------------------------- + echo 0 + #------------------------------------------------------------------------------- + fi #------------------------------------------------------------------------------- diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index 40a5bc26c6..6537feb98a 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 -21 -1 +22 +0 From 96b5b6f8167dcd10d306eedbce8bf0a83ece7e68 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 9 Feb 2019 13:47:20 +0100 Subject: [PATCH 002/232] v6.22 + DietPi-Update | Fix syntax: We are not in a function here --- dietpi/dietpi-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index bd335d78e2..d996c329fe 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -525,7 +525,7 @@ Please download the latest DietPi image:\n - https://dietpi.com/#download\n\n - G_DIETPI-NOTIFY 2 "$INFO_CURRENT_VERSION" G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION" - local do_reboot=0 + do_reboot=0 # - 1st run setup if (( $G_DIETPI_INSTALL_STAGE < 2 )); then From b9926b146242dbd0d234354b2e04a9fe47f796a9 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 9 Feb 2019 20:55:38 +0100 Subject: [PATCH 003/232] v6.22 + DietPi-Software | WireGuard: Switch from 10.8.0.0 to 10.9.0.0 IP addresses, to avoid double use with OpenVPN + DietPi-Software | WireGuard: Replace 127.0.0.1/localhost loopback DNS entries in client config by VPN server IP 10.9.0.1 + DietPi-Software | OpenVPN: Use drop-in /etc/sysctl.d/dietpi-openvpn.conf to apply IP forwarding; Add IPv6 forwarding as well; Use sysctl command to apply settings now + DietPi-Software | WiFi Hotspot: Use drop-in /etc/sysctl.d/dietpi-wifihotspot.conf to apply IP forwarding; Add IPv6 forwarding as well; Use sysctl command to apply settings now --- dietpi/dietpi-software | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 67eb37632f..f087572cc8 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4915,11 +4915,11 @@ _EOF_ local existing_install=0 dpkg-query -s wireguard-dkms &> /dev/null && existing_install=1 - # iptables required to forward incoming VPN traffic to internet interface + # iptables required to forward incoming VPN traffic to local LAN/internet interface # qrencode required to print client config QR code to console G_AGI wireguard iptables qrencode - # If no fresh install, reconfigure to rebuild WireGuard kernel module against current kernel headers + # If existing install, reconfigure to rebuild WireGuard kernel module against current kernel + headers (( $existing_install )) && G_RUN_CMD dpkg-reconfigure wireguard-dkms unset kernel_packages existing_install @@ -9921,8 +9921,9 @@ _EOF_ # - and /boot partition cp /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn /boot/ - #enable ipv4 forwarding - sed -i '/net.ipv4.ip_forward=/c\net.ipv4.ip_forward=1' /etc/sysctl.conf + #Enable IP forwarding + echo -e 'net.ipv4.ip_forward=1\nnet.ipv6.conf.all.forwarding=1\nnet.ipv6.conf.default.forwarding=1' > /etc/sysctl.d/dietpi-openvpn.conf + sysctl net.ipv4.ip_forward=1 net.ipv6.conf.all.forwarding=1 net.ipv6.conf.default.forwarding=1 #Web Fowarding (Setup IPtables, must also be run during boot) #iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o "$(sed -n 3p /DietPi/dietpi/.network)" -j MASQUERADE @@ -10013,7 +10014,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal # - Server config [[ -f wg0.conf ]] || cat << _EOF_ > wg0.conf [Interface] -Address = 10.8.0.1/24 +Address = 10.9.0.1/24 PrivateKey = $( wg0-client.conf [Interface] -# The address must be unique for each client, use "10.8.0.3/24" for the second client and so on. -Address = 10.8.0.2/24 +# The address must be unique for each client, use "10.9.0.3/24" for the second client and so on. +Address = 10.9.0.2/24 PrivateKey = $( /etc/sysctl.d/dietpi-wireguard.conf @@ -10183,9 +10190,9 @@ _EOF_ DAEMON_CONF="/etc/hostapd/hostapd.conf" _EOF_ - # - Enable IPv4 forwarding - sed -i "/net.ipv4.ip_forward=/c\net.ipv4.ip_forward=1" /etc/sysctl.conf - echo 1 > /proc/sys/net/ipv4/ip_forward + # - Enable IP forwarding + echo -e 'net.ipv4.ip_forward=1\nnet.ipv6.conf.all.forwarding=1\nnet.ipv6.conf.default.forwarding=1' > /etc/sysctl.d/dietpi-wifihotspot.conf + sysctl net.ipv4.ip_forward=1 net.ipv6.conf.all.forwarding=1 net.ipv6.conf.default.forwarding=1 # - Apply iptables iptables -t nat -A POSTROUTING -o eth$eth_index -j MASQUERADE @@ -13638,12 +13645,13 @@ _EOF_ fi - software_id=97 + software_id=97 # OpenVPN server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP openvpn [[ -d /etc/openvpn ]] && rm -R /etc/openvpn + [[ -f /etc/sysctl.d/dietpi-openvpn.conf ]] && rm /etc/sysctl.d/dietpi-openvpn.conf fi @@ -13743,6 +13751,9 @@ _EOF_ rm /usr/sbin/hostapd &> /dev/null rm /usr/sbin/hostapd_cli &> /dev/null + # IP forwarding + [[ -f /etc/sysctl.d/dietpi-wifihotspot.conf ]] && rm /etc/sysctl.d/dietpi-wifihotspot.conf + #Set Wlan back to inactive and ready for use with dietpi-config. local wifi_index=$(sed -n 2p /DietPi/dietpi/.network) From 27bcbbd5769fa24df80eff08c864cf1667d895b6 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 9 Feb 2019 21:08:12 +0100 Subject: [PATCH 004/232] v6.22 + CHANGELOG | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs + CHANGELOG | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used --- CHANGELOG.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1c5f3c7a9f..6155c5d471 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,8 +3,10 @@ v6.22 (xx/02/19) Changes / Improvements / Optimisations: ++ DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @@XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 Bug Fixes: ++ DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster From 71f68731ed83a0fdc031d8af268482016b38258c Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Sat, 9 Feb 2019 17:17:04 -0600 Subject: [PATCH 005/232] dietpi-autostart comment typo interger => integer --- dietpi/dietpi-autostart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart index fb5a45005c..76623d750c 100644 --- a/dietpi/dietpi-autostart +++ b/dietpi/dietpi-autostart @@ -23,7 +23,7 @@ G_INIT #Import DietPi-Globals --------------------------------------------------------------- - #Grab Input (valid interger) + #Grab Input (valid integer) INPUT=-1 disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 From 9f2bd1a23ee3f28c7d1945a4fca1a1e4afb33e92 Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Sat, 9 Feb 2019 17:43:18 -0600 Subject: [PATCH 006/232] PREP_SYSTEM_FOR_DIETPI.sh comment typo fixes sucessfully => successfully histroy => history parition => partition mininum => minimum --- PREP_SYSTEM_FOR_DIETPI.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index bcc235a6e7..8efc28ad2d 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -145,7 +145,7 @@ # DietPi-Globals #------------------------------------------------------------------------------------------------ # - Download - # - NB: We'll have to manually handle errors, until DietPi-Globals are sucessfully loaded. + # - NB: We'll have to manually handle errors, until DietPi-Globals are successfully loaded. if ! wget "https://raw.githubusercontent.com/$GITOWNER/DietPi/$GITBRANCH/dietpi/func/dietpi-globals" -O dietpi-globals; then echo -e '[FAILED] Unable to download dietpi-globals. Aborting...\n' @@ -1466,7 +1466,7 @@ _EOF_ [[ -f ~/.bash_history ]] && rm ~/.bash_history rm -f /home/*/.bash_history - # - Remove Nano histroy file + # - Remove Nano history file [[ -f ~/.nano_history ]] && rm ~/.nano_history rm -f /home/*/.nano_history @@ -1671,7 +1671,7 @@ _EOF_ #Read image - #Resize rootfs parition to mininum size +50MB + #Resize rootfs partition to minimum size +50MB } From 3922a73afbd2543095632aea7dae95027fe2d80a Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 10 Feb 2019 14:45:05 +0000 Subject: [PATCH 007/232] v6.22 General | Resolved an issue where /etc/bashrc.d entries could be run multiple times: https://github.com/Fourdee/DietPi/issues/2529 --- CHANGELOG.txt | 1 + dietpi/patch_file | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1c5f3c7a9f..02e7c9f784 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ v6.22 Changes / Improvements / Optimisations: Bug Fixes: +- General | Resolved an issue where /etc/bashrc.d entries could be run multiple times: https://github.com/Fourdee/DietPi/issues/2529 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster diff --git a/dietpi/patch_file b/dietpi/patch_file index 850fd128e2..953e8badf0 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1647,7 +1647,9 @@ Also have a look at "Sonarr", another alternative TV show manager, available for elif (( $G_DIETPI_VERSION_SUB == 21 )); then #------------------------------------------------------------------------------- - echo 0 + #Redo our /etc/bash.bashrc entry, user confirmed 4 entries: https://github.com/Fourdee/DietPi/issues/2529 + sed -i '\#for i in /etc/bashrc#d' /etc/bash.bashrc + G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc #------------------------------------------------------------------------------- fi From 5b815f3c05021603ffecba718848a1491e037f96 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 10 Feb 2019 14:55:03 +0000 Subject: [PATCH 008/232] v6.22 + Credit https://github.com/Fourdee/DietPi/issues/2529 + Consistency --- CHANGELOG.txt | 2 +- PREP_SYSTEM_FOR_DIETPI.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 02e7c9f784..b768d1ca2b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,7 +5,7 @@ v6.22 Changes / Improvements / Optimisations: Bug Fixes: -- General | Resolved an issue where /etc/bashrc.d entries could be run multiple times: https://github.com/Fourdee/DietPi/issues/2529 +- General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 8efc28ad2d..183b1d11e7 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -933,12 +933,12 @@ _EOF_ local aservices=( # - ARMbian - firstrun - resize2fs - log2ram - armbian* + 'firstrun' + 'resize2fs' + 'log2ram' + 'armbian*' # - Meveric - cpu_governor + 'cpu_governor' ) From 718e1a6e09ae28bb3f4780f85ebdc92d24b18198 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 10 Feb 2019 17:55:15 +0100 Subject: [PATCH 009/232] v6.22 + DietPi-Patch | Tiny: Avoid install "/etc/bashrc.d/" entry twice + tiny coding --- dietpi/patch_file | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 953e8badf0..60045b42ed 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -195,7 +195,7 @@ fi #------------------------------------------------------------------------------- #https://dietpi.com/phpbb/viewtopic.php?f=11&t=2772&p=10646#p10646 - rm /etc/apt/sources.list.d/openmediavault.list &> /dev/null + [[ -f /etc/apt/sources.list.d/openmediavault.list ]] && rm /etc/apt/sources.list.d/openmediavault.list #------------------------------------------------------------------------------- #DietPi-Software removals: https://github.com/Fourdee/DietPi/issues/1491 if [[ -f /DietPi/dietpi/.installed ]]; then @@ -212,8 +212,7 @@ fi #------------------------------------------------------------------------------- #Nodered lacks homedir, create it: https://github.com/Fourdee/DietPi/issues/1446#issuecomment-366370800 - if grep -qi '^nodered:' /etc/passwd && - [[ ! -d /home/nodered ]]; then + if grep -qi '^nodered:' /etc/passwd && [[ ! -d /home/nodered ]]; then mkdir -p /home/nodered chown -R nodered:nodered /home/nodered @@ -262,7 +261,7 @@ StandardOutput=tty WantedBy=multi-user.target _EOF_ - systemctl enable rc-local.service + systemctl enable rc-local systemctl enable dietpi-postboot if (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[168\]=2' /DietPi/dietpi/.installed; then @@ -290,7 +289,7 @@ _EOF_ sed -i 's@https://oph.mdrjr.net/meveric@http://fuzon.co.uk/meveric@' /etc/apt/sources.list.d/meveric* &> /dev/null #------------------------------------------------------------------------------- #Remove any existing apt recommends settings, before applying ours: https://github.com/Fourdee/DietPi/issues/1482#issuecomment-368031044 - rm /etc/apt/apt.conf.d/*recommends* &> /dev/null + rm -f /etc/apt/apt.conf.d/*recommends* G_ERROR_HANDLER_COMMAND='/etc/apt/apt.conf.d/99-dietpi-norecommends' cat << _EOF_ > $G_ERROR_HANDLER_COMMAND @@ -348,7 +347,7 @@ _EOF_ # Odroids FFmpeg decendency fix: https://github.com/Fourdee/DietPi/issues/1556#issuecomment-369463910 if (( $G_HW_MODEL > 9 && $G_HW_MODEL < 15 )); then - rm /etc/apt/preferences.d/meveric* + rm -f /etc/apt/preferences.d/meveric* cat << _EOF_ > /etc/apt/preferences.d/backports Package: * Pin: release a=jessie-backports @@ -623,7 +622,7 @@ _EOF_ #------------------------------------------------------------------------------- #Move DietPi globals and login scripts into new /etc/bashrc.d location to load on all interactive shells: mkdir -p /etc/bashrc.d - G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc + # => v6.22 #G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc sed -i '/\/DietPi/d' /root/.bashrc #should already be removed, failsafe start clean for i in /home/*/.bashrc; do sed -i '/\/DietPi/d' $i; done #should already be removed, failsafe start clean rm /etc/profile.d/99-dietpi* &> /dev/null From 8e718cc6ae208b78aa9e8b41e836ec35afe33a8c Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 11 Feb 2019 18:19:26 +0000 Subject: [PATCH 010/232] v6.22 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 2 +- dietpi/patch_file | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b768d1ca2b..de440544d7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 +- DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 67eb37632f..b4a823c8ef 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8723,7 +8723,7 @@ _EOF_ fi # - Adjust user group and home dir - usermod -a -G dietpi -d $G_FP_DIETPI_USERDATA/mopidy mopidy + usermod -a -G dietpi,audio -d $G_FP_DIETPI_USERDATA/mopidy mopidy # - Adjust systemd unit to match new group and do not pre-create obsolete cache dir mkdir -p /etc/systemd/system/mopidy.service.d diff --git a/dietpi/patch_file b/dietpi/patch_file index 953e8badf0..144ad4a4f1 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1651,6 +1651,13 @@ Also have a look at "Sonarr", another alternative TV show manager, available for sed -i '\#for i in /etc/bashrc#d' /etc/bash.bashrc G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc #------------------------------------------------------------------------------- + #Mopidy fix: https://github.com/Fourdee/DietPi/issues/2536 + if grep -q '^mopidy' /etc/passwd; then + + usermod -a -G dietpi,audio -d $G_FP_DIETPI_USERDATA/mopidy mopidy + + fi + #------------------------------------------------------------------------------- fi From 33abe47dce5333436f42dab25681552f705314c7 Mon Sep 17 00:00:00 2001 From: songz Date: Tue, 12 Feb 2019 02:35:12 +0800 Subject: [PATCH 011/232] add aria2 config option: rpc allow origin all to fix using 3rd party plugin; and comment unknown option; --- dietpi/dietpi-software | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 67eb37632f..44b426c8ae 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11107,12 +11107,12 @@ _EOF_ G_BACKUP_FP /var/lib/dietpi/dietpi-software/installed/aria2.conf cat << _EOF_ > /var/lib/dietpi/dietpi-software/installed/aria2.conf # host is where aria2c is running on -host=localhost +# host=localhost dir=$G_FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS # cleanup_policy -cleanup-policy=clean_got -cleanup-percent=90% +# cleanup-policy=clean_got +# cleanup-percent=90% # The fallowing options are aria2c options as usual aria2.conf file # https://aria2.github.io/manual/en/html/aria2c.html @@ -11122,6 +11122,7 @@ enable-rpc=true rpc-listen-all=true rpc-listen-port=6800 rpc-secret=$GLOBAL_PW +rpc-allow-origin-all=true pause=false # General Options @@ -11148,18 +11149,18 @@ max-download-limit=0 seed-ratio=0.1 seed-time=0 -metalink-servers=$(Optimize_BitTorrent 2) +# metalink-servers=$(Optimize_BitTorrent 2) allow-overwrite=false always-resume=true auto-file-renaming=false file-allocation=none -[limit-options] +# [limit-options] max-concurrent-downloads=$(Optimize_BitTorrent 1) max-overall-download-limit=1000K max-overall-upload-limit=100K -[unlimit-options] +# [unlimit-options] max-concurrent-downloads=$(Optimize_BitTorrent 1) max-overall-download-limit=0 max-overall-upload-limit=0 From 4798faa17d9038370e4ab26cd1a463f4bf860a15 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 11 Feb 2019 18:51:50 +0000 Subject: [PATCH 012/232] v6.22 + Minor/consistency --- dietpi/dietpi-update | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index d996c329fe..c80fb27f0c 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -45,6 +45,7 @@ UPDATE_AVAILABLE=0 UPDATE_REQUIRESNEWIMAGE=0 RUN_UPDATE=0 + DO_REBOOT=0 GITOWNER_TARGET=$(grep -m1 '^[[:blank:]]*DEV_GITOWNER=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') GITOWNER_TARGET=${GITOWNER_TARGET:-Fourdee} @@ -525,22 +526,20 @@ Please download the latest DietPi image:\n - https://dietpi.com/#download\n\n - G_DIETPI-NOTIFY 2 "$INFO_CURRENT_VERSION" G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION" - do_reboot=0 - # - 1st run setup if (( $G_DIETPI_INSTALL_STAGE < 2 )); then Apply_1st_Run_Update_Sucess G_WHIP_MSG 'DietPi has been updated to the latest version.\n\nThe system will now reboot. Once completed, simply login to resume DietPi Setup.\n\nPress Enter to Continue.' - do_reboot=1 + DO_REBOOT=1 # - Reboot prompt, if system is already installed else G_WHIP_YESNO "[ OK ] Update applied\n Current version: $INFO_CURRENT_VERSION\n -A system reboot is required to finalise the update. Would you like to reboot the system now?" && do_reboot=1 +A system reboot is required to finalise the update. Would you like to reboot the system now?" && DO_REBOOT=1 fi @@ -550,7 +549,7 @@ A system reboot is required to finalise the update. Would you like to reboot the G_RUN_CMD systemctl restart dietpi-ramdisk sync - (( $do_reboot )) && reboot + (( $DO_REBOOT )) && reboot /DietPi/dietpi/dietpi-services restart From 1272bf921fcd26ee9ce2f990a0d70e5463e7efa8 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 11 Feb 2019 20:30:08 +0000 Subject: [PATCH 013/232] v6.22 + Prevent initial update section running if already running. --- dietpi/login | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/dietpi/login b/dietpi/login index e8d9fcff0e..50d68c115a 100644 --- a/dietpi/login +++ b/dietpi/login @@ -157,21 +157,32 @@ # - 1st run dietpi-update if (( $G_DIETPI_INSTALL_STAGE == 0 )); then - # Check internet - optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | awk '{print $2}')" # Will exit on failure here then prompt user to configure network + if pgrep 'dietpi-update' &> /dev/null; then - # Check NTP synced - /DietPi/dietpi/func/run_ntpd + local additional_text='Please resume setup on the active screen.' + grep -q '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt && additional_text='Automated installation update is in progress, the system will reboot automatically when completed.' - # Show GPL license - if [[ -f /var/lib/dietpi/license.txt ]]; then + G_WHIP_MSG "DietPi is currently running on another screen.\n\n$additional_text" - G_WHIP_VIEWFILE /var/lib/dietpi/license.txt - rm /var/lib/dietpi/license.txt + else - fi + # Check internet + optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | awk '{print $2}')" # Will exit on failure here then prompt user to configure network + + # Check NTP synced + /DietPi/dietpi/func/run_ntpd + + # Show GPL license + if [[ -f /var/lib/dietpi/license.txt ]]; then + + G_WHIP_VIEWFILE /var/lib/dietpi/license.txt + rm /var/lib/dietpi/license.txt - /DietPi/dietpi/dietpi-update 1 #Sets G_DIETPI_INSTALL_STAGE=1 + fi + + /DietPi/dietpi/dietpi-update 1 #Sets G_DIETPI_INSTALL_STAGE=1 + + fi # - 1st run dietpi-software installs elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then From 0a90f864793e92341870d78d06736bd2c9f980c3 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 11 Feb 2019 22:35:21 +0100 Subject: [PATCH 014/232] v6.22 + DietPi-Software | Aria2: Remove deprecated settings (instead of comment only); Remove doubled settings; Add bandwidth limit info --- dietpi/dietpi-software | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 44b426c8ae..7ce410d614 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11106,17 +11106,12 @@ _EOF_ G_BACKUP_FP /var/lib/dietpi/dietpi-software/installed/aria2.conf cat << _EOF_ > /var/lib/dietpi/dietpi-software/installed/aria2.conf -# host is where aria2c is running on -# host=localhost -dir=$G_FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS - -# cleanup_policy -# cleanup-policy=clean_got -# cleanup-percent=90% - # The fallowing options are aria2c options as usual aria2.conf file # https://aria2.github.io/manual/en/html/aria2c.html +# Download directory +dir=$G_FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS + # RPC Options enable-rpc=true rpc-listen-all=true @@ -11134,6 +11129,9 @@ continue=true check-integrity=true max-concurrent-downloads=$(Optimize_BitTorrent 1) max-connection-per-server=$(Optimize_BitTorrent 1) +# Bandwidth limits: https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-max-overall-upload-limit +max-overall-download-limit=0 +max-overall-upload-limit=0 max-file-not-found=3 max-tries=5 retry-wait=60 @@ -11149,21 +11147,10 @@ max-download-limit=0 seed-ratio=0.1 seed-time=0 -# metalink-servers=$(Optimize_BitTorrent 2) allow-overwrite=false always-resume=true auto-file-renaming=false file-allocation=none - -# [limit-options] -max-concurrent-downloads=$(Optimize_BitTorrent 1) -max-overall-download-limit=1000K -max-overall-upload-limit=100K - -# [unlimit-options] -max-concurrent-downloads=$(Optimize_BitTorrent 1) -max-overall-download-limit=0 -max-overall-upload-limit=0 _EOF_ cat << _EOF_ > /etc/systemd/system/aria2.service From 03394b9338e438aeea3263a1efb9e71e588d14b7 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 11 Feb 2019 22:54:46 +0100 Subject: [PATCH 015/232] v6.22 + CHANGELOG | Aria2: Config tweak/fix --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index de440544d7..ba72f18902 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.22 (xx/02/19) Changes / Improvements / Optimisations: +- DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 From f967a547899d07603937563fba9dcbf57807b797 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Feb 2019 12:39:05 +0100 Subject: [PATCH 016/232] v6.22 + DietPi-Software | Java: Reapply workaround to fix ARM install issue --- dietpi/dietpi-software | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f10da36ada..53b8e12d7c 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6726,6 +6726,8 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Banner_Installing + local packages='ca-certificates-java openjdk-8-jre-headless openjdk-8-jdk-headless' + # On Jessie use backports repo: if (( $G_DISTRO == 3 )); then @@ -6735,14 +6737,14 @@ Pin: release a=jessie-backports Pin-Priority: 990 _EOF_ - G_AGI openjdk-8-jre-headless openjdk-8-jdk-headless -t jessie-backports - - else - - G_AGI openjdk-8-jre-headless openjdk-8-jdk-headless + packages+=' -t jessie-backports' fi + # Workaround for ARM install issue: https://github.com/Fourdee/DietPi/issues/2524 + apt-get install -y -qq $packages + G_AGI $package + fi software_id=9 From 92d9dca4ba3733bded2a87064441bcddc642f7e6 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Feb 2019 12:42:44 +0100 Subject: [PATCH 017/232] v6.22 + CHANGELOG | Java: Resolved an issue where install failed on ARM --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ba72f18902..c5b970f095 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 +- DietPi-Software | Java: Resolved an issue where install failed on ARM. Thanks to @WTFMaster for reporting this issue: https://github.com/Fourdee/DietPi/issues/2524 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster From 7a274847d64ad8838dbd77c9992fa58f3be78a0b Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Feb 2019 15:28:15 +0100 Subject: [PATCH 018/232] v6.22 + DietPi-Software | WireGuard: Add multiple clients as own [Peer] entries, so allow concurrent connections --- dietpi/dietpi-software | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e6eecf8a47..77460a90a6 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -10021,9 +10021,15 @@ ListenPort = $port PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o \$(sed -n 3p /DietPi/dietpi/.network) -j MASQUERADE PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o \$(sed -n 3p /DietPi/dietpi/.network) -j MASQUERADE +# Client 1 [Peer] PublicKey = $( wg0-client.conf [Interface] -# The address must be unique for each client, use "10.9.0.3/24" for the second client and so on. Address = 10.9.0.2/24 PrivateKey = $( Date: Tue, 12 Feb 2019 17:24:41 +0100 Subject: [PATCH 019/232] v6.22 + DietPi-Software | Java: Fix wrong variable --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 53b8e12d7c..89a0dedb54 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6743,7 +6743,7 @@ _EOF_ # Workaround for ARM install issue: https://github.com/Fourdee/DietPi/issues/2524 apt-get install -y -qq $packages - G_AGI $package + G_AGI $packages fi From 902bc21921bf1167fa00923375e3b907d82ff31c Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 12 Feb 2019 19:31:55 +0000 Subject: [PATCH 020/232] v6.22 - DietPi-NordVPN | Added sent/recieved usage stats for VPN tunnel. --- CHANGELOG.txt | 1 + dietpi/misc/dietpi-nordvpn | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2d226e8487..2f02989b87 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.22 (xx/02/19) Changes / Improvements / Optimisations: +- DietPi-NordVPN | Added sent/recieved usage stats for VPN tunnel. - DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @@XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 diff --git a/dietpi/misc/dietpi-nordvpn b/dietpi/misc/dietpi-nordvpn index b9ce207832..e03808127d 100644 --- a/dietpi/misc/dietpi-nordvpn +++ b/dietpi/misc/dietpi-nordvpn @@ -30,6 +30,7 @@ NORDVPN_SERVER='' PROTOCOL='udp' + NET_DEV='tun0' NORDVPN_CONNECTED=0 MAX_WAIT_FOR_CONNECTION=5 @@ -61,7 +62,7 @@ NORDVPN_CONNECTED=0 local status=1 #if systemctl status dietpi-nordvpn | grep -qi 'initialization sequence completed'; then - if ip r | grep -q 'tun0'; then + if ip r | grep -q $NET_DEV; then status=0 NORDVPN_CONNECTED=1 @@ -161,7 +162,34 @@ _EOF_ local text_status='Status:\n' if Check_Connected; then - text_status+=" - Connected to $NORDVPN_SERVER" + text_status+=" - Connected : $NORDVPN_SERVER\n" + + local net_rx_byte=0 + local net_tx_byte=0 + local net_rx_mb='N/A' + local net_tx_mb='N/A' + + if [[ -f /sys/class/net/$NET_DEV/statistics/rx_bytes && -f /sys/class/net/$NET_DEV/statistics/tx_bytes ]]; then + + net_rx_byte=$( 0 )); then + + net_rx_mb="$(( $net_rx_byte / 1024 / 1024 ))MB" + + fi + + net_tx_mb='Unknown' + if disable_error=1 G_CHECK_VALIDINT $net_tx_byte && (( $net_tx_byte > 0 )); then + + net_tx_mb="$(( $net_tx_byte / 1024 / 1024 ))MB" + + fi + + fi + + text_status+=" - Usage : Sent = $net_tx_mb | Recieved = $net_rx_mb" else From 11b1a4b9b9f0722f5210ce55866aa8c6004d720b Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 02:39:15 +0100 Subject: [PATCH 021/232] v6.22 + DietPi-Login | Remove "Filesystem prep" install state info, as this does not exist anymore, instead warn user about unknown install state, ask for check and report issue + DietPi-Login | Prompt G_WHIP_MSG, if install state is "-1" to make this more prominent + DietPi-Login | Check for root user before starting first run setup, otherwise ask user to login as root + DietPi-Login | Assure that user accepts license interactively one time: Skip on automated install to have it shown on first normal login instead + DietPi-Login | If on first run setup dietpi-update or dietpi-software is running in other session, show same G_WHIP once and exit script to prevent user from being kept in loop that can never be resolved in this session. + DietPi-Login | Re-read install state after first run update and dietpi-software run, to exit loop if immediate reboot was skipped. Allow update and installs in a single loop, e.g. if already on latest version, so second loop is an error indicator. Inform user in case. Apply install state 0, if not valid before second loop to prevent unlimited repeats. --- dietpi/login | 193 ++++++++++++++++++++++++++++----------------------- 1 file changed, 108 insertions(+), 85 deletions(-) diff --git a/dietpi/login b/dietpi/login index 50d68c115a..85a05624f1 100644 --- a/dietpi/login +++ b/dietpi/login @@ -13,7 +13,7 @@ # - activates on login /etc/bashrc.d/dietpi-login.sh #//////////////////////////////////// - #Precaution: Wait for DietPi Ramdisk to finish + # Precaution: Wait for DietPi RAMdisk to finish until [[ -f /DietPi/.ramdisk ]] do @@ -22,35 +22,35 @@ done - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Login' #G_INIT - ##Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// - #Globals + # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' FP_TMP_DIETPI_FIRSTRUNSETUP_LOG='/tmp/dietpi-firstrun-setup.log' #///////////////////////////////////////////////////////////////////////////////////// - #DietPi-Autostart + # DietPi-Autostart #///////////////////////////////////////////////////////////////////////////////////// AUTO_START_INDEX=0 [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && AUTO_START_INDEX=$(= $max_seconds )) && break done - #Kodi + # - Kodi if (( $AUTO_START_INDEX == 1 )); then /DietPi/dietpi/misc/start_kodi - #Desktop (LXDE/MATE etc) + # - Desktop (LXDE/MATE etc) elif (( $AUTO_START_INDEX == 2 )); then clear @@ -84,49 +82,46 @@ fi - #RetroPie/Emulation station + # - RetroPie/Emulation station elif (( $AUTO_START_INDEX == 3 )); then - #emulationstation - can no longer be run as root + # emulationstation - can no longer be run as root /opt/retropie/supplementary/emulationstation/emulationstation.sh - #OpenTyrian + # - OpenTyrian elif (( $AUTO_START_INDEX == 4 )); then /usr/local/games/opentyrian/run - #DietPi-Cloudshell + # - DietPi-Cloudshell elif (( $AUTO_START_INDEX == 5 )); then - #Launch DietPi-Cloudshell setterm --blank 0 --powersave off --cursor off systemctl start dietpi-cloudshell - #Amiberry standard boot + # - Amiberry standard boot elif (( $AUTO_START_INDEX == 8 )); then systemctl start amiberry - #DXX-Rebirth + # - DXX-Rebirth elif (( $AUTO_START_INDEX == 9 )); then $G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh - #CAVA + # - CAVA elif (( $AUTO_START_INDEX == 10 )); then - # wait for MPD fifo to start - sleep 4 - + sleep 4 # Wait for MPD fifo to start setterm --blank 0 --powersave off cava - #Chromium + # - Chromium elif (( $AUTO_START_INDEX == 11 )); then /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh - #LightDM + # - LightDM elif (( $AUTO_START_INDEX == 16 )); then /usr/sbin/lightdm @@ -139,89 +134,92 @@ Run_First_Update_Setup(){ - /DietPi/dietpi/func/dietpi-banner 0 local automated_setup=0 - until (( $G_DIETPI_INSTALL_STAGE == 2 )) - do - - # - Automated? - if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then + # First run setup running in other session + Other_Session_User_Prompt(){ - automated_setup=1 - # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) - export G_USER_INPUTS=0 + local additional_text='Please resume setup on the active screen.' + (( $automated_setup )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' - fi + # Force interactive whiptail + G_USER_INPUTS=1 G_WHIP_MSG "[WARNING] DietPi is currently running on another screen.\n\n$additional_text" - # - 1st run dietpi-update - if (( $G_DIETPI_INSTALL_STAGE == 0 )); then + exit - if pgrep 'dietpi-update' &> /dev/null; then + } - local additional_text='Please resume setup on the active screen.' - grep -q '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt && additional_text='Automated installation update is in progress, the system will reboot automatically when completed.' + # Automated? + if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then - G_WHIP_MSG "DietPi is currently running on another screen.\n\n$additional_text" + automated_setup=1 + # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) + export G_USER_INPUTS=0 - else + fi - # Check internet - optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | awk '{print $2}')" # Will exit on failure here then prompt user to configure network + # Show GPL license + if [[ -f /var/lib/dietpi/license.txt ]] && (( ! $automated_setup )); then - # Check NTP synced - /DietPi/dietpi/func/run_ntpd + G_WHIP_VIEWFILE /var/lib/dietpi/license.txt + rm /var/lib/dietpi/license.txt - # Show GPL license - if [[ -f /var/lib/dietpi/license.txt ]]; then + fi - G_WHIP_VIEWFILE /var/lib/dietpi/license.txt - rm /var/lib/dietpi/license.txt + until (( $G_DIETPI_INSTALL_STAGE == 2 )) + do - fi + # 1st run dietpi-update + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then - /DietPi/dietpi/dietpi-update 1 #Sets G_DIETPI_INSTALL_STAGE=1 + # - Prompt and exit if DietPi-Update runs in other session already + pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt - fi + # - Check internet + optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | mawk '{print $2}')" # Will exit on failure here then prompt user to configure network - # - 1st run dietpi-software installs - elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then + # - Check NTP synced + /DietPi/dietpi/func/run_ntpd - # Wait for DietPi-Software if already running, else run it - local run_dietpi_software=1 - while pgrep 'dietpi-software' &> /dev/null - do + # - Start DietPi-Update + /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 - run_dietpi_software=0 + # - Update install state, to allow DietPi-Software in same loop, if no update was required + export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt - G_DIETPI-NOTIFY 2 'DietPi-Software is already running on another terminal/screen. Please complete or exit, before continuing.' + # - Start DietPi-Software + /DietPi/dietpi/dietpi-software | tee $FP_TMP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + mv $FP_TMP_DIETPI_FIRSTRUNSETUP_LOG $FP_DIETPI_FIRSTRUNSETUP_LOG - fi + # - Update install state, to exit loop, if user skipped immediate reboot + export G_DIETPI_INSTALL_STAGE=$( /DietPi/dietpi/.install_stage; } - fi + G_WHIP_MSG "[FAILED] First run setup failed\n +An error has occured either during first run update or installs.\n +First run setup will now try to re-apply the last step. +If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues" fi - # - reset to auto detection - unset G_USER_INPUTS - done } @@ -234,32 +232,57 @@ /DietPi/dietpi/func/obtain_network_details #---------------------------------------------------------------- - #Normal Login + # Normal Login if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + # - Show GPL license on first normal login, if setup was automated + if [[ -f /var/lib/dietpi/license.txt ]]; then + + G_WHIP_VIEWFILE /var/lib/dietpi/license.txt + rm /var/lib/dietpi/license.txt + + fi + /DietPi/dietpi/func/dietpi-banner 1 (( $AUTO_START_INDEX > 0 )) && Run_AutoStart #---------------------------------------------------------------- - #Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) - elif (( $G_DIETPI_INSTALL_STAGE >= 0 )); then + # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) + elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then - Run_First_Update_Setup + /DietPi/dietpi/func/dietpi-banner 0 + + if (( $UID )); then + + G_WHIP_MSG '[WARNING] Root login required\n +To finish DietPi first run setup, root permissions are required.\n +Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' + + else + + Run_First_Update_Setup + + fi #---------------------------------------------------------------- - #DietPi finishing up bootloader. + # DietPi-Boot first run setup not finished elif (( $G_DIETPI_INSTALL_STAGE == -1 )); then /DietPi/dietpi/func/dietpi-banner 0 - echo -e ' >> DietPi System prep is nearly completed: \n Please run /DietPi/dietpi/login after a few seconds.' + G_WHIP_MSG '[WARNING] Boot scripts still running\n +DietPi boot scripts have not yet finished system preparations.\n +Please run "/DietPi/dietpi/login" after a few seconds, to start first run setup.' #---------------------------------------------------------------- - #DietPi running filesystem prep + # Unknown install state else /DietPi/dietpi/func/dietpi-banner 0 - echo -e ' >> Filesystem prep has not yet completed: \n Please wait for the system to reboot.' + G_WHIP_MSG '[WARNING] Unknown install state\n +DietPi could not determine a valid install state. Please check if DietPi boot scripts have successfully finished:\n + systemctl status dietpi-*\n +In case report this issue to: https://github.com/Fourdee/DietPi/issues' fi From 27db0019546b00ef659ef13d7344554451bb0df6 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 03:28:07 +0100 Subject: [PATCH 022/232] v6.22 + DietPi-Banner | Coding --- dietpi/func/dietpi-banner | 81 ++++++++++++++------------------------- 1 file changed, 29 insertions(+), 52 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 823f17b423..8c14362b5d 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -17,28 +17,20 @@ # - dietpi-banner 1 = top section and credits + clear #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Banner' G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- INPUT=0 - if disable_error=1 G_CHECK_VALIDINT $1; then - - INPUT=$1 - - fi + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 #///////////////////////////////////////////////////////////////////////////////////// - #Globals + # Globals #///////////////////////////////////////////////////////////////////////////////////// DIETPI_VERSION="$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC" - if [[ $G_GITBRANCH != 'master' ]]; then - - DIETPI_VERSION+=" ($G_GITBRANCH)" - - fi + [[ $G_GITBRANCH != 'master' ]] && DIETPI_VERSION+=" ($G_GITBRANCH)" IMAGE_ADDITIONAL_CREDITS=$(sed -n 8p /DietPi/dietpi/.hw_model) @@ -53,11 +45,11 @@ } UPDATE_AVAILABLE=0 - UPDATE_AVAILABLE_VERSION='' #-1 = image required, other value=latest version + UPDATE_AVAILABLE_VERSION='' # -1 = image required, other value = latest version Obtain_Update_Available(){ - #Update Available + # Update Available if [[ -f '/DietPi/dietpi/.update_available' ]]; then UPDATE_AVAILABLE=1 @@ -75,12 +67,8 @@ IPAddress_Print(){ - #Try to re-obtain IP if missing - if [[ -z $IP_ADDRESS ]]; then - - Update_Ip_Address - - fi + # Try to re-obtain IP if missing + [[ $IP_ADDRESS ]] || Update_Ip_Address echo -e " \e[1m$IP_ADAPTER\e[0m \e[90m| $IP_ADDRESS\e[0m\n \e[38;5;154m────────────────────────────────────────────────\e[0m" @@ -93,23 +81,23 @@ Banner_TopText_Extras(){ - #Update Available + # Update Available if (( $UPDATE_AVAILABLE )); then if [[ $UPDATE_AVAILABLE_VERSION == '-1' ]]; then - TEXT_TOP="\e[90m| \e[1;33mImage available\e[0m" + TEXT_TOP='\e[90m| \e[1;33mImage available\e[0m' else - TEXT_TOP="\e[90m| \e[1;33mUpdate available\e[0m" + TEXT_TOP='\e[90m| \e[1;33mUpdate available\e[0m' fi - #Use TEXT_TOP for storing helpful info + # Use TEXT_TOP for storing helpful info else - #Helpful mode + # Helpful mode TEXT_TOP="\e[90m| $(date +"%a %x - %R")\e[0m" fi @@ -117,31 +105,24 @@ Banner_Dietpi(){ - if (( $INPUT == 1 )); then - - printf '\ec' # clear current terminal screen - - fi + (( $INPUT == 1 )) && printf '\ec' # clear current terminal screen echo -e " \e[38;5;154m────────────────────────────────────────────────\e[0m\n \e[1mDietPi\e[0m $TEXT_TOP\n \e[38;5;154m────────────────────────────────────────────────\e[0m" Hardware_Model_Print IPAddress_Print + } Credits_Print(){ - echo -e "\e[90m DietPi Team : Daniel Knight (founder), MichaIng, K-Plan\e[0m" + echo -e '\e[90m DietPi Team : Daniel Knight (founder), MichaIng, K-Plan\e[0m' local fp_prep_info='/DietPi/dietpi/.prep_info' if [[ -f $fp_prep_info ]]; then - local image_creator="$(sed -n 1p $fp_prep_info)" - local preimage_name="$(sed -n 2p $fp_prep_info)" - if [[ $image_creator == '0' ]]; then - - image_creator='DietPi Core Team' - - fi + local image_creator=$(sed -n 1p $fp_prep_info) + local preimage_name=$(sed -n 2p $fp_prep_info) + [[ $image_creator == '0' ]] && image_creator='DietPi Core Team' echo -e "\e[90m Image : $image_creator (pre-image: $preimage_name)\e[0m" @@ -153,23 +134,19 @@ Patreon Legends : PINE64 community Donate : https://DietPi.com/#donate' - if [[ $IMAGE_ADDITIONAL_CREDITS ]]; then - - echo -e "\n\ Device image possible thanks to: $IMAGE_ADDITIONAL_CREDITS" - - fi + [[ $IMAGE_ADDITIONAL_CREDITS ]] && echo -e "\n\ Device image possible thanks to: $IMAGE_ADDITIONAL_CREDITS" - echo -e " DietPi Hosting : Powered by https://MyVirtualServer.com\e[0m" - echo -e "\n\e[1m dietpi-launcher\e[0m = All the DietPi programs in one place." - echo -e "\e[1m dietpi-config\e[0m = Feature rich configuration tool for your device." - echo -e "\e[1m dietpi-software\e[0m = Select optimized software for installation." + echo -e ' DietPi Hosting : Powered by https://MyVirtualServer.com\e[0m\n +\e[1m dietpi-launcher\e[0m = All the DietPi programs in one place. +\e[1m dietpi-config\e[0m = Feature rich configuration tool for your device. +\e[1m dietpi-software\e[0m = Select optimized software for installation.' - #Update available? + # Update available? if (( $UPDATE_AVAILABLE )); then if [[ $UPDATE_AVAILABLE_VERSION = '-1' ]]; then - echo -e "\n\e[1;31m Updated DietPi image is available, please download it:\e[0m\n https://dietpi.com/download\n" + echo -e '\n\e[1;31m Updated DietPi image is available, please download it:\e[0m\n https://dietpi.com/download\n' else @@ -179,8 +156,8 @@ fi - echo -e "\e[1m htop\e[0m = Resource monitor." - echo -e "\e[1m cpu\e[0m = Shows CPU information and stats.\n" + echo -e '\e[1m htop\e[0m = Resource monitor. +\e[1m cpu\e[0m = Shows CPU information and stats.\n' } From 95e29fcc2bbd770d1783985bb4a06a97d6540590 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 13 Feb 2019 17:17:33 +0000 Subject: [PATCH 023/232] v6.22 + Minor code + Log to disk --- dietpi/login | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dietpi/login b/dietpi/login index 85a05624f1..b28642c10f 100644 --- a/dietpi/login +++ b/dietpi/login @@ -32,7 +32,6 @@ # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' - FP_TMP_DIETPI_FIRSTRUNSETUP_LOG='/tmp/dietpi-firstrun-setup.log' #///////////////////////////////////////////////////////////////////////////////////// # DietPi-Autostart @@ -196,8 +195,7 @@ pgrep 'dietpi-software' &> /dev/null && Other_Session_User_Prompt # - Start DietPi-Software - /DietPi/dietpi/dietpi-software | tee $FP_TMP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - mv $FP_TMP_DIETPI_FIRSTRUNSETUP_LOG $FP_DIETPI_FIRSTRUNSETUP_LOG + /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 # - Update install state, to exit loop, if user skipped immediate reboot export G_DIETPI_INSTALL_STAGE=$( Date: Wed, 13 Feb 2019 17:36:15 +0000 Subject: [PATCH 024/232] v6.22 + Minor optimization --- dietpi/login | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/dietpi/login b/dietpi/login index b28642c10f..d40d79388e 100644 --- a/dietpi/login +++ b/dietpi/login @@ -13,15 +13,6 @@ # - activates on login /etc/bashrc.d/dietpi-login.sh #//////////////////////////////////// - # Precaution: Wait for DietPi RAMdisk to finish - until [[ -f /DietPi/.ramdisk ]] - do - - G_DIETPI-NOTIFY 2 'Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM...' - sleep 1 - - done - # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Login' @@ -33,12 +24,6 @@ #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' - #///////////////////////////////////////////////////////////////////////////////////// - # DietPi-Autostart - #///////////////////////////////////////////////////////////////////////////////////// - AUTO_START_INDEX=0 - [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && AUTO_START_INDEX=$( 0 )) && Run_AutoStart + local auto_start_index=0 + [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart #---------------------------------------------------------------- # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) From f303a3014ec71dcfa393737429dd3a58af956716 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 13 Feb 2019 17:43:07 +0000 Subject: [PATCH 025/232] v6.22 + revert --- dietpi/login | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/login b/dietpi/login index d40d79388e..85e65d5f62 100644 --- a/dietpi/login +++ b/dietpi/login @@ -189,7 +189,7 @@ fi # Check for second loop and in case inform user, since this indicates an error - if (( $G_DIETPI_INSTALL_STAGE != 2 )); then + if ! (( $G_DIETPI_INSTALL_STAGE == 2 )); then # - Force interactive mode to show G_WHIP error prompts export G_USER_INPUTS=1 @@ -273,5 +273,6 @@ In case report this issue to: https://github.com/Fourdee/DietPi/issues' #----------------------------------------------------------------------------------- exit + #Run loop, update globals after updates, no reboots required? #----------------------------------------------------------------------------------- } From ee924aaa1d3b7c6e72d943f9fe7bc0d4ff7cb272 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 18:49:47 +0100 Subject: [PATCH 026/232] v6.22 + DietPi-Boot | Assure it has finished before OpenSSH and Dropbear to prevent too early login + DietPi-Boot | Add "Before=getty-pre.target" which is reached on Buster before any getty starts. This is actually what we want, does not exist on Stretch yet but does not harm to add. On Buster we should add it to Wants= as well, as it is not pulled in automatically. But on Stretch this would produce an error, as it does not exist. --- rootfs/etc/systemd/system/dietpi-boot.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/systemd/system/dietpi-boot.service b/rootfs/etc/systemd/system/dietpi-boot.service index a0c8804dc7..e90a1b3bb5 100644 --- a/rootfs/etc/systemd/system/dietpi-boot.service +++ b/rootfs/etc/systemd/system/dietpi-boot.service @@ -3,7 +3,7 @@ Description=DietPi-Boot # Order 3 Requires=dietpi-preboot.service After=dietpi-preboot.service network.target networking.service -Before=getty@tty1.service getty.target +Before=getty-pre.target getty@tty1.service getty.target ssh.service dropbear.service [Service] Type=oneshot From 1d718e4291ee983c8d13d313b0a27720311c3e7d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 19:43:31 +0100 Subject: [PATCH 027/232] v6.22 + DietPi-Login | Log STDERR to first run setup log as well + DietPi-Login | Add info comment why we use "! (( $G_DIETPI_INSTALL_STAGE == 2 ))", to not forget --- dietpi/login | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/login b/dietpi/login index 85e65d5f62..7b094a9b6d 100644 --- a/dietpi/login +++ b/dietpi/login @@ -181,7 +181,7 @@ pgrep 'dietpi-software' &> /dev/null && Other_Session_User_Prompt # - Start DietPi-Software - /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + /DietPi/dietpi/dietpi-software 2>&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 # - Update install state, to exit loop, if user skipped immediate reboot export G_DIETPI_INSTALL_STAGE=$( Date: Wed, 13 Feb 2019 19:22:34 +0000 Subject: [PATCH 028/232] v6.22 + fix: Does not run on RPi during boot. --- dietpi/login | 207 ++++++++---------- .../systemd/system/dietpi-postboot.service | 2 +- 2 files changed, 98 insertions(+), 111 deletions(-) diff --git a/dietpi/login b/dietpi/login index 85e65d5f62..ac001a85a6 100644 --- a/dietpi/login +++ b/dietpi/login @@ -14,9 +14,7 @@ #//////////////////////////////////// # Import DietPi-Globals -------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Login' - #G_INIT + # In main loop # Import DietPi-Globals -------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -34,19 +32,6 @@ # - Boot to specific program if (( $screen_valid )); then - # - Wait for DietPi-PostBoot - local max_seconds=15 - local current_seconds=1 - until systemctl status dietpi-postboot | grep -qi 'exited' - do - - G_DIETPI-NOTIFY 2 "Waiting for DietPi-Postboot to finish ($current_seconds/$max_seconds)" - sleep 1 - ((current_seconds++)) - (( $current_seconds >= $max_seconds )) && break - - done - # - Kodi if (( $AUTO_START_INDEX == 1 )); then @@ -119,13 +104,11 @@ # First Run Setup Run_First_Update_Setup(){ - local automated_setup=0 - # First run setup running in other session Other_Session_User_Prompt(){ local additional_text='Please resume setup on the active screen.' - (( $automated_setup )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' + (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' # Force interactive whiptail G_USER_INPUTS=1 G_WHIP_MSG "[WARNING] DietPi is currently running on another screen.\n\n$additional_text" @@ -134,145 +117,149 @@ } - # Automated? - if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then + # 1st run dietpi-update + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then - automated_setup=1 - # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) - export G_USER_INPUTS=0 + # - Prompt and exit if DietPi-Update runs in other session already + pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt - fi + # - Check internet + optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | mawk '{print $2}')" # Will exit on failure here then prompt user to configure network - # Show GPL license - if [[ -f /var/lib/dietpi/license.txt ]] && (( ! $automated_setup )); then + # - Check NTP synced + /DietPi/dietpi/func/run_ntpd - G_WHIP_VIEWFILE /var/lib/dietpi/license.txt - rm /var/lib/dietpi/license.txt + # - Start DietPi-Update + /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 - fi + # - Update install state, to allow DietPi-Software in same loop + export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt - # - Prompt and exit if DietPi-Update runs in other session already - pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt + # - Start DietPi-Software + /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - # - Check internet - optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | mawk '{print $2}')" # Will exit on failure here then prompt user to configure network + # - Update install state, to exit loop, if user skipped immediate reboot + export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt + fi - # - Start DietPi-Software - /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + } - # - Update install state, to exit loop, if user skipped immediate reboot - export G_DIETPI_INSTALL_STAGE=$( /DietPi/dietpi/.install_stage; } + G_DIETPI-NOTIFY 2 'Waiting for DietPi-Postboot to finish, before executing login script.' + sleep 1 - G_WHIP_MSG "[FAILED] First run setup failed\n -An error has occured either during first run update or installs.\n -First run setup will now try to re-apply the last step. -If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues" + done - fi + # - Automated install? + if (( $G_DIETPI_INSTALL_STAGE < 2 )) && grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then - done + # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) + export G_USER_INPUTS=0 - } + fi - #///////////////////////////////////////////////////////////////////////////////////// - # Main Loop - #///////////////////////////////////////////////////////////////////////////////////// + /DietPi/dietpi/func/obtain_network_details - #Update network details for banner IP address. - /DietPi/dietpi/func/obtain_network_details + Show_License - #---------------------------------------------------------------- - # Normal Login - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + #---------------------------------------------------------------- + # Normal Login + if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - # - Show GPL license on first normal login, if setup was automated - if [[ -f /var/lib/dietpi/license.txt ]]; then + /DietPi/dietpi/func/dietpi-banner 1 - G_WHIP_VIEWFILE /var/lib/dietpi/license.txt - rm /var/lib/dietpi/license.txt + local auto_start_index=0 + [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart - fi + break - /DietPi/dietpi/func/dietpi-banner 1 - local auto_start_index=0 - [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart + #---------------------------------------------------------------- + # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) + elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then - #---------------------------------------------------------------- - # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) - elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then + /DietPi/dietpi/func/dietpi-banner 0 + if (( $G_CHECK_ROOT_USER_VERIFIED )); then - /DietPi/dietpi/func/dietpi-banner 0 + Run_First_Update_Setup - if (( $UID )); then + else - G_WHIP_MSG '[WARNING] Root login required\n + G_WHIP_MSG '[WARNING] Root login required\n To finish DietPi first run setup, root permissions are required.\n Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' - else + break - Run_First_Update_Setup + fi - fi + #---------------------------------------------------------------- + # Unknown install state + else - #---------------------------------------------------------------- - # DietPi-Boot first run setup not finished - elif (( $G_DIETPI_INSTALL_STAGE == -1 )); then + /DietPi/dietpi/func/dietpi-banner 0 - /DietPi/dietpi/func/dietpi-banner 0 - G_WHIP_MSG '[WARNING] Boot scripts still running\n -DietPi boot scripts have not yet finished system preparations.\n -Please run "/DietPi/dietpi/login" after a few seconds, to start first run setup.' + # - Force interactive mode to show G_WHIP error prompts + export G_USER_INPUTS=1 - #---------------------------------------------------------------- - # Unknown install state - else + if G_WHIP_YESNO "[FAILED] Unknown install state/First run setup failed\n +An error has occured either during first run update or installs.\n +First run setup will now attempt to re-apply the last step. +If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues\n\nWould you like to restart the first run setup and installation?"; then - /DietPi/dietpi/func/dietpi-banner 0 - G_WHIP_MSG '[WARNING] Unknown install state\n -DietPi could not determine a valid install state. Please check if DietPi boot scripts have successfully finished:\n - systemctl status dietpi-*\n -In case report this issue to: https://github.com/Fourdee/DietPi/issues' + # - reset to 0 to force update and fix code + echo 0 > /DietPi/dietpi/.install_stage - fi + else + + break + + fi + + fi + + done + + } + + #///////////////////////////////////////////////////////////////////////////////////// + # Main Loop + #///////////////////////////////////////////////////////////////////////////////////// + Main #----------------------------------------------------------------------------------- exit - #Run loop, update globals after updates, no reboots required? #----------------------------------------------------------------------------------- } diff --git a/rootfs/etc/systemd/system/dietpi-postboot.service b/rootfs/etc/systemd/system/dietpi-postboot.service index 30c7672188..204dc67008 100644 --- a/rootfs/etc/systemd/system/dietpi-postboot.service +++ b/rootfs/etc/systemd/system/dietpi-postboot.service @@ -2,7 +2,7 @@ Description=DietPi-PostBoot # Order 4 Requires=dietpi-boot.service -After=dietpi-boot.service multi-user.target +After=dietpi-boot.service [Service] Type=idle From ac7975c48f9884fd09369363563eb8ff59500c09 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 13 Feb 2019 19:22:41 +0000 Subject: [PATCH 029/232] Revert "v6.22" This reverts commit 1467813234e7eb0e41cd6038c89f23d7e8bac0bd. --- dietpi/login | 207 ++++++++++-------- .../systemd/system/dietpi-postboot.service | 2 +- 2 files changed, 111 insertions(+), 98 deletions(-) diff --git a/dietpi/login b/dietpi/login index ac001a85a6..85e65d5f62 100644 --- a/dietpi/login +++ b/dietpi/login @@ -14,7 +14,9 @@ #//////////////////////////////////// # Import DietPi-Globals -------------------------------------------------------------- - # In main loop + . /DietPi/dietpi/func/dietpi-globals + G_PROGRAM_NAME='DietPi-Login' + #G_INIT # Import DietPi-Globals -------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -32,6 +34,19 @@ # - Boot to specific program if (( $screen_valid )); then + # - Wait for DietPi-PostBoot + local max_seconds=15 + local current_seconds=1 + until systemctl status dietpi-postboot | grep -qi 'exited' + do + + G_DIETPI-NOTIFY 2 "Waiting for DietPi-Postboot to finish ($current_seconds/$max_seconds)" + sleep 1 + ((current_seconds++)) + (( $current_seconds >= $max_seconds )) && break + + done + # - Kodi if (( $AUTO_START_INDEX == 1 )); then @@ -104,11 +119,13 @@ # First Run Setup Run_First_Update_Setup(){ + local automated_setup=0 + # First run setup running in other session Other_Session_User_Prompt(){ local additional_text='Please resume setup on the active screen.' - (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' + (( $automated_setup )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' # Force interactive whiptail G_USER_INPUTS=1 G_WHIP_MSG "[WARNING] DietPi is currently running on another screen.\n\n$additional_text" @@ -117,149 +134,145 @@ } - # 1st run dietpi-update - if (( $G_DIETPI_INSTALL_STAGE == 0 )); then + # Automated? + if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then - # - Prompt and exit if DietPi-Update runs in other session already - pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt + automated_setup=1 + # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) + export G_USER_INPUTS=0 - # - Check internet - optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | mawk '{print $2}')" # Will exit on failure here then prompt user to configure network + fi - # - Check NTP synced - /DietPi/dietpi/func/run_ntpd + # Show GPL license + if [[ -f /var/lib/dietpi/license.txt ]] && (( ! $automated_setup )); then - # - Start DietPi-Update - /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 + G_WHIP_VIEWFILE /var/lib/dietpi/license.txt + rm /var/lib/dietpi/license.txt - # - Update install state, to allow DietPi-Software in same loop - export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt + # 1st run dietpi-update + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then - # - Start DietPi-Software - /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + # - Prompt and exit if DietPi-Update runs in other session already + pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt - # - Update install state, to exit loop, if user skipped immediate reboot - export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt - } + # - Start DietPi-Software + /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - Main(){ + # - Update install state, to exit loop, if user skipped immediate reboot + export G_DIETPI_INSTALL_STAGE=$( /DietPi/dietpi/.install_stage; } - done + G_WHIP_MSG "[FAILED] First run setup failed\n +An error has occured either during first run update or installs.\n +First run setup will now try to re-apply the last step. +If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues" - # - Automated install? - if (( $G_DIETPI_INSTALL_STAGE < 2 )) && grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then + fi - # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) - export G_USER_INPUTS=0 + done - fi + } - /DietPi/dietpi/func/obtain_network_details + #///////////////////////////////////////////////////////////////////////////////////// + # Main Loop + #///////////////////////////////////////////////////////////////////////////////////// - Show_License + #Update network details for banner IP address. + /DietPi/dietpi/func/obtain_network_details - #---------------------------------------------------------------- - # Normal Login - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + #---------------------------------------------------------------- + # Normal Login + if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - /DietPi/dietpi/func/dietpi-banner 1 + # - Show GPL license on first normal login, if setup was automated + if [[ -f /var/lib/dietpi/license.txt ]]; then - local auto_start_index=0 - [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart + G_WHIP_VIEWFILE /var/lib/dietpi/license.txt + rm /var/lib/dietpi/license.txt - break + fi - #---------------------------------------------------------------- - # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) - elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then + /DietPi/dietpi/func/dietpi-banner 1 + local auto_start_index=0 + [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart - /DietPi/dietpi/func/dietpi-banner 0 - if (( $G_CHECK_ROOT_USER_VERIFIED )); then + #---------------------------------------------------------------- + # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) + elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then - Run_First_Update_Setup + /DietPi/dietpi/func/dietpi-banner 0 - else + if (( $UID )); then - G_WHIP_MSG '[WARNING] Root login required\n + G_WHIP_MSG '[WARNING] Root login required\n To finish DietPi first run setup, root permissions are required.\n Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' - break - - fi + else - #---------------------------------------------------------------- - # Unknown install state - else + Run_First_Update_Setup - /DietPi/dietpi/func/dietpi-banner 0 - - # - Force interactive mode to show G_WHIP error prompts - export G_USER_INPUTS=1 - - if G_WHIP_YESNO "[FAILED] Unknown install state/First run setup failed\n -An error has occured either during first run update or installs.\n -First run setup will now attempt to re-apply the last step. -If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues\n\nWould you like to restart the first run setup and installation?"; then - - # - reset to 0 to force update and fix code - echo 0 > /DietPi/dietpi/.install_stage - - else - - break + fi - fi + #---------------------------------------------------------------- + # DietPi-Boot first run setup not finished + elif (( $G_DIETPI_INSTALL_STAGE == -1 )); then - fi + /DietPi/dietpi/func/dietpi-banner 0 + G_WHIP_MSG '[WARNING] Boot scripts still running\n +DietPi boot scripts have not yet finished system preparations.\n +Please run "/DietPi/dietpi/login" after a few seconds, to start first run setup.' - done + #---------------------------------------------------------------- + # Unknown install state + else - } + /DietPi/dietpi/func/dietpi-banner 0 + G_WHIP_MSG '[WARNING] Unknown install state\n +DietPi could not determine a valid install state. Please check if DietPi boot scripts have successfully finished:\n + systemctl status dietpi-*\n +In case report this issue to: https://github.com/Fourdee/DietPi/issues' - #///////////////////////////////////////////////////////////////////////////////////// - # Main Loop - #///////////////////////////////////////////////////////////////////////////////////// - Main + fi #----------------------------------------------------------------------------------- exit + #Run loop, update globals after updates, no reboots required? #----------------------------------------------------------------------------------- } diff --git a/rootfs/etc/systemd/system/dietpi-postboot.service b/rootfs/etc/systemd/system/dietpi-postboot.service index 204dc67008..30c7672188 100644 --- a/rootfs/etc/systemd/system/dietpi-postboot.service +++ b/rootfs/etc/systemd/system/dietpi-postboot.service @@ -2,7 +2,7 @@ Description=DietPi-PostBoot # Order 4 Requires=dietpi-boot.service -After=dietpi-boot.service +After=dietpi-boot.service multi-user.target [Service] Type=idle From bcb380667f5616f6c6fdf63d264f3f55f49a5baa Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 13 Feb 2019 19:23:03 +0000 Subject: [PATCH 030/232] v6.22 + Fix: does not run on RPi during boot. --- rootfs/etc/systemd/system/dietpi-postboot.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/systemd/system/dietpi-postboot.service b/rootfs/etc/systemd/system/dietpi-postboot.service index 30c7672188..204dc67008 100644 --- a/rootfs/etc/systemd/system/dietpi-postboot.service +++ b/rootfs/etc/systemd/system/dietpi-postboot.service @@ -2,7 +2,7 @@ Description=DietPi-PostBoot # Order 4 Requires=dietpi-boot.service -After=dietpi-boot.service multi-user.target +After=dietpi-boot.service [Service] Type=idle From 2ec69cf3581ecc8e7af1666716d93d42298bc2ad Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 13 Feb 2019 19:24:06 +0000 Subject: [PATCH 031/232] v6.22 + Login script rewrite + Minimize system reboots required aftert updates Not finished yet, will test and patch. --- dietpi/dietpi-software | 2 + dietpi/dietpi-update | 21 +---- dietpi/login | 207 +++++++++++++++++++---------------------- 3 files changed, 101 insertions(+), 129 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a371c26c91..c1f826e7b5 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -16172,6 +16172,8 @@ NB: You can use dietpi-software at a later date, to install optimized software f #exit menu system TARGETMENUID=-1 + DISABLE_REBOOT=1 + #Enable installation start flag GOSTARTINSTALL=1 diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index c80fb27f0c..be61dfbb83 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -410,7 +410,6 @@ Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SE } - #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// @@ -527,21 +526,7 @@ Please download the latest DietPi image:\n - https://dietpi.com/#download\n\n - G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION" # - 1st run setup - if (( $G_DIETPI_INSTALL_STAGE < 2 )); then - - Apply_1st_Run_Update_Sucess - - G_WHIP_MSG 'DietPi has been updated to the latest version.\n\nThe system will now reboot. Once completed, simply login to resume DietPi Setup.\n\nPress Enter to Continue.' - DO_REBOOT=1 - - # - Reboot prompt, if system is already installed - else - - G_WHIP_YESNO "[ OK ] Update applied\n -Current version: $INFO_CURRENT_VERSION\n -A system reboot is required to finalise the update. Would you like to reboot the system now?" && DO_REBOOT=1 - - fi + Apply_1st_Run_Update_Sucess # Failsafe: Restart RAMdisk + sync to disk # - https://github.com/Fourdee/DietPi/issues/2473#issuecomment-458874222 @@ -549,9 +534,7 @@ A system reboot is required to finalise the update. Would you like to reboot the G_RUN_CMD systemctl restart dietpi-ramdisk sync - (( $DO_REBOOT )) && reboot - - /DietPi/dietpi/dietpi-services restart + (( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-services restart fi diff --git a/dietpi/login b/dietpi/login index 85e65d5f62..ac001a85a6 100644 --- a/dietpi/login +++ b/dietpi/login @@ -14,9 +14,7 @@ #//////////////////////////////////// # Import DietPi-Globals -------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Login' - #G_INIT + # In main loop # Import DietPi-Globals -------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -34,19 +32,6 @@ # - Boot to specific program if (( $screen_valid )); then - # - Wait for DietPi-PostBoot - local max_seconds=15 - local current_seconds=1 - until systemctl status dietpi-postboot | grep -qi 'exited' - do - - G_DIETPI-NOTIFY 2 "Waiting for DietPi-Postboot to finish ($current_seconds/$max_seconds)" - sleep 1 - ((current_seconds++)) - (( $current_seconds >= $max_seconds )) && break - - done - # - Kodi if (( $AUTO_START_INDEX == 1 )); then @@ -119,13 +104,11 @@ # First Run Setup Run_First_Update_Setup(){ - local automated_setup=0 - # First run setup running in other session Other_Session_User_Prompt(){ local additional_text='Please resume setup on the active screen.' - (( $automated_setup )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' + (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' # Force interactive whiptail G_USER_INPUTS=1 G_WHIP_MSG "[WARNING] DietPi is currently running on another screen.\n\n$additional_text" @@ -134,145 +117,149 @@ } - # Automated? - if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then + # 1st run dietpi-update + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then - automated_setup=1 - # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) - export G_USER_INPUTS=0 + # - Prompt and exit if DietPi-Update runs in other session already + pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt - fi + # - Check internet + optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | mawk '{print $2}')" # Will exit on failure here then prompt user to configure network - # Show GPL license - if [[ -f /var/lib/dietpi/license.txt ]] && (( ! $automated_setup )); then + # - Check NTP synced + /DietPi/dietpi/func/run_ntpd - G_WHIP_VIEWFILE /var/lib/dietpi/license.txt - rm /var/lib/dietpi/license.txt + # - Start DietPi-Update + /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 - fi + # - Update install state, to allow DietPi-Software in same loop + export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt - # - Prompt and exit if DietPi-Update runs in other session already - pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt + # - Start DietPi-Software + /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - # - Check internet - optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | mawk '{print $2}')" # Will exit on failure here then prompt user to configure network + # - Update install state, to exit loop, if user skipped immediate reboot + export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt + fi - # - Start DietPi-Software - /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + } - # - Update install state, to exit loop, if user skipped immediate reboot - export G_DIETPI_INSTALL_STAGE=$( /DietPi/dietpi/.install_stage; } + G_DIETPI-NOTIFY 2 'Waiting for DietPi-Postboot to finish, before executing login script.' + sleep 1 - G_WHIP_MSG "[FAILED] First run setup failed\n -An error has occured either during first run update or installs.\n -First run setup will now try to re-apply the last step. -If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues" + done - fi + # - Automated install? + if (( $G_DIETPI_INSTALL_STAGE < 2 )) && grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then - done + # Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) + export G_USER_INPUTS=0 - } + fi - #///////////////////////////////////////////////////////////////////////////////////// - # Main Loop - #///////////////////////////////////////////////////////////////////////////////////// + /DietPi/dietpi/func/obtain_network_details - #Update network details for banner IP address. - /DietPi/dietpi/func/obtain_network_details + Show_License - #---------------------------------------------------------------- - # Normal Login - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + #---------------------------------------------------------------- + # Normal Login + if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - # - Show GPL license on first normal login, if setup was automated - if [[ -f /var/lib/dietpi/license.txt ]]; then + /DietPi/dietpi/func/dietpi-banner 1 - G_WHIP_VIEWFILE /var/lib/dietpi/license.txt - rm /var/lib/dietpi/license.txt + local auto_start_index=0 + [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart - fi + break - /DietPi/dietpi/func/dietpi-banner 1 - local auto_start_index=0 - [[ -f /DietPi/dietpi/.dietpi-autostart_index ]] && auto_start_index=$( 0 )) && Run_AutoStart + #---------------------------------------------------------------- + # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) + elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then - #---------------------------------------------------------------- - # Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1) - elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then + /DietPi/dietpi/func/dietpi-banner 0 + if (( $G_CHECK_ROOT_USER_VERIFIED )); then - /DietPi/dietpi/func/dietpi-banner 0 + Run_First_Update_Setup - if (( $UID )); then + else - G_WHIP_MSG '[WARNING] Root login required\n + G_WHIP_MSG '[WARNING] Root login required\n To finish DietPi first run setup, root permissions are required.\n Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' - else + break - Run_First_Update_Setup + fi - fi + #---------------------------------------------------------------- + # Unknown install state + else - #---------------------------------------------------------------- - # DietPi-Boot first run setup not finished - elif (( $G_DIETPI_INSTALL_STAGE == -1 )); then + /DietPi/dietpi/func/dietpi-banner 0 - /DietPi/dietpi/func/dietpi-banner 0 - G_WHIP_MSG '[WARNING] Boot scripts still running\n -DietPi boot scripts have not yet finished system preparations.\n -Please run "/DietPi/dietpi/login" after a few seconds, to start first run setup.' + # - Force interactive mode to show G_WHIP error prompts + export G_USER_INPUTS=1 - #---------------------------------------------------------------- - # Unknown install state - else + if G_WHIP_YESNO "[FAILED] Unknown install state/First run setup failed\n +An error has occured either during first run update or installs.\n +First run setup will now attempt to re-apply the last step. +If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues\n\nWould you like to restart the first run setup and installation?"; then - /DietPi/dietpi/func/dietpi-banner 0 - G_WHIP_MSG '[WARNING] Unknown install state\n -DietPi could not determine a valid install state. Please check if DietPi boot scripts have successfully finished:\n - systemctl status dietpi-*\n -In case report this issue to: https://github.com/Fourdee/DietPi/issues' + # - reset to 0 to force update and fix code + echo 0 > /DietPi/dietpi/.install_stage - fi + else + + break + + fi + + fi + + done + + } + + #///////////////////////////////////////////////////////////////////////////////////// + # Main Loop + #///////////////////////////////////////////////////////////////////////////////////// + Main #----------------------------------------------------------------------------------- exit - #Run loop, update globals after updates, no reboots required? #----------------------------------------------------------------------------------- } From d7df082b24f220e843b156e0717ce13e681ce6cb Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 13 Feb 2019 19:40:29 +0000 Subject: [PATCH 032/232] v6.22 + Fix --- dietpi/login | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dietpi/login b/dietpi/login index ac001a85a6..bc8fbc3647 100644 --- a/dietpi/login +++ b/dietpi/login @@ -211,6 +211,8 @@ elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then /DietPi/dietpi/func/dietpi-banner 0 + + G_CHECK_ROOT_USER if (( $G_CHECK_ROOT_USER_VERIFIED )); then Run_First_Update_Setup From 923468ec0677ad7c5677149dfe64a23c045e7869 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 13 Feb 2019 19:46:33 +0000 Subject: [PATCH 033/232] v6.22 + Minor --- dietpi/dietpi-update | 1 - dietpi/login | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index be61dfbb83..678afcd221 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -45,7 +45,6 @@ UPDATE_AVAILABLE=0 UPDATE_REQUIRESNEWIMAGE=0 RUN_UPDATE=0 - DO_REBOOT=0 GITOWNER_TARGET=$(grep -m1 '^[[:blank:]]*DEV_GITOWNER=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') GITOWNER_TARGET=${GITOWNER_TARGET:-Fourdee} diff --git a/dietpi/login b/dietpi/login index bc8fbc3647..a8d8835be8 100644 --- a/dietpi/login +++ b/dietpi/login @@ -144,7 +144,7 @@ # - Start DietPi-Software /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - # - Update install state, to exit loop, if user skipped immediate reboot + # - Update install state, to exit loop, if no software changes made/reboot required export G_DIETPI_INSTALL_STAGE=$( Date: Wed, 13 Feb 2019 21:07:14 +0100 Subject: [PATCH 034/232] v6.22 + DietPi-Update | Spelling --- dietpi/dietpi-update | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 678afcd221..69b08c7e57 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -402,7 +402,7 @@ Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SE } - Apply_1st_Run_Update_Sucess(){ + Apply_1st_Run_Update_Success(){ # - 1st run setup (( $G_DIETPI_INSTALL_STAGE < 2 )) && echo 1 > /DietPi/dietpi/.install_stage @@ -489,7 +489,7 @@ Please download the latest DietPi image:\n - https://dietpi.com/#download\n\n - G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION" G_DIETPI-NOTIFY 0 'No updates required, your DietPi installation is up to date.\n' - Apply_1st_Run_Update_Sucess + Apply_1st_Run_Update_Success fi @@ -525,7 +525,7 @@ Please download the latest DietPi image:\n - https://dietpi.com/#download\n\n - G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION" # - 1st run setup - Apply_1st_Run_Update_Sucess + Apply_1st_Run_Update_Success # Failsafe: Restart RAMdisk + sync to disk # - https://github.com/Fourdee/DietPi/issues/2473#issuecomment-458874222 From faf3550610de9eb336082848da558939da1d9e2e Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 21:21:38 +0100 Subject: [PATCH 035/232] v6.22 + DietPi-Login | Remove "export G_DIETPI_INSTALL_STAGE" since every loop re-reads this via DietPi-Globals + DietPi-Login | Log STDERR to first run setup log as well --- dietpi/login | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/dietpi/login b/dietpi/login index a8d8835be8..3aa2fa3ba2 100644 --- a/dietpi/login +++ b/dietpi/login @@ -132,9 +132,6 @@ # - Start DietPi-Update /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 - # - Update install state, to allow DietPi-Software in same loop - export G_DIETPI_INSTALL_STAGE=$( /dev/null && Other_Session_User_Prompt # - Start DietPi-Software - /DietPi/dietpi/dietpi-software | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - - # - Update install state, to exit loop, if no software changes made/reboot required - export G_DIETPI_INSTALL_STAGE=$(&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 fi From 2c5d01ad46696ad4e32a8ae63972fb737b28400d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 22:19:19 +0100 Subject: [PATCH 036/232] v6.22 + DietPi-Login | Fix changed AUTO_START_INDEX => auto_start_index + DietPi-Login | Check for PostBoot finish only once before loop: Tiny speed-up of following loops + DietPi-Login | Check for AUTO_SETUP_AUTOMATED only once before loop, to have "export G_USER_INPUTS=0" not being overwritten on error --- dietpi/login | 54 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/dietpi/login b/dietpi/login index 3aa2fa3ba2..ef35f2d400 100644 --- a/dietpi/login +++ b/dietpi/login @@ -33,12 +33,12 @@ if (( $screen_valid )); then # - Kodi - if (( $AUTO_START_INDEX == 1 )); then + if (( $auto_start_index == 1 )); then /DietPi/dietpi/misc/start_kodi # - Desktop (LXDE/MATE etc) - elif (( $AUTO_START_INDEX == 2 )); then + elif (( $auto_start_index == 2 )); then clear if (( $G_HW_MODEL == 11 )); then @@ -52,46 +52,46 @@ fi # - RetroPie/Emulation station - elif (( $AUTO_START_INDEX == 3 )); then + elif (( $auto_start_index == 3 )); then # emulationstation - can no longer be run as root /opt/retropie/supplementary/emulationstation/emulationstation.sh # - OpenTyrian - elif (( $AUTO_START_INDEX == 4 )); then + elif (( $auto_start_index == 4 )); then /usr/local/games/opentyrian/run # - DietPi-Cloudshell - elif (( $AUTO_START_INDEX == 5 )); then + elif (( $auto_start_index == 5 )); then setterm --blank 0 --powersave off --cursor off systemctl start dietpi-cloudshell # - Amiberry standard boot - elif (( $AUTO_START_INDEX == 8 )); then + elif (( $auto_start_index == 8 )); then systemctl start amiberry # - DXX-Rebirth - elif (( $AUTO_START_INDEX == 9 )); then + elif (( $auto_start_index == 9 )); then $G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh # - CAVA - elif (( $AUTO_START_INDEX == 10 )); then + elif (( $auto_start_index == 10 )); then sleep 4 # Wait for MPD fifo to start setterm --blank 0 --powersave off cava # - Chromium - elif (( $AUTO_START_INDEX == 11 )); then + elif (( $auto_start_index == 11 )); then /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh # - LightDM - elif (( $AUTO_START_INDEX == 16 )); then + elif (( $auto_start_index == 16 )); then /usr/sbin/lightdm @@ -158,31 +158,31 @@ Main(){ - while : + # Wait for full system boot + until systemctl status dietpi-postboot | grep -qi 'exited' do - # Import DietPi-Globals -------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Login' - #G_INIT - # Import DietPi-Globals -------------------------------------------------------------- + echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Waiting for DietPi-Postboot to finish, before executing login script...' + sleep 1 - # - Wait for full system boot - until systemctl status dietpi-postboot | grep -qi 'exited' - do + done - G_DIETPI-NOTIFY 2 'Waiting for DietPi-Postboot to finish, before executing login script.' - sleep 1 + # Automated first run setup? + if (( $( Date: Wed, 13 Feb 2019 23:20:12 +0100 Subject: [PATCH 037/232] v6.22 + DietPi-Software | WireGuard: Fix Debian Sid repo not being removed correctly on uninstall --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c1f826e7b5..a7fd03b77e 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13656,7 +13656,7 @@ _EOF_ Banner_Uninstalling G_AGP wireguard* [[ -d /etc/wireguard ]] && rm -R /etc/wireguard - [[ -f /etc/apt/sources.d/dietpi-wireguard.list ]] && rm /etc/apt/sources.d/dietpi-wireguard.list + [[ -f /etc/apt/sources.list.d/dietpi-wireguard.list ]] && rm /etc/apt/sources.list.d/dietpi-wireguard.list [[ -f /etc/apt/preferences.d/dietpi-wireguard ]] && rm /etc/apt/preferences.d/dietpi-wireguard [[ -f /etc/sysctl.d/dietpi-wireguard.conf ]] && rm /etc/sysctl.d/dietpi-wireguard.conf From 484f34751ced06bb00eba0aff2393cba9d50fb54 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Feb 2019 23:23:23 +0100 Subject: [PATCH 038/232] v6.22 + CHANGELOG | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed --- CHANGELOG.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2f02989b87..cb4259505a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,7 +4,7 @@ v6.22 Changes / Improvements / Optimisations: - DietPi-NordVPN | Added sent/recieved usage stats for VPN tunnel. -- DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @@XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 +- DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 @@ -12,6 +12,7 @@ Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 - DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 +- DietPi-Software | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed. Thanks to @XRay437 for reporting this issue: https://github.com/Fourdee/DietPi/issues/2545 - DietPi-Software | Java: Resolved an issue where install failed on ARM. Thanks to @WTFMaster for reporting this issue: https://github.com/Fourdee/DietPi/issues/2524 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster From d1dbf3c0a3f56c0b9b1612ab4d29dde5c85c1150 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Feb 2019 00:52:02 +0100 Subject: [PATCH 039/232] v6.22 + DietPi-Set_Hardware | I-Sabre-K2M: Fix module source build, add informational comments --- dietpi/func/dietpi-set_hardware | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index fbb0eabd85..ddd76912e8 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1988,7 +1988,9 @@ _EOF_ local old_firmware=$(ls /lib/modules/) local rpi_firmware='raspberrypi-bootloader raspberrypi-kernel libraspberrypi-bin libraspberrypi0' G_AGUP - G_AGI $rpi_firmware raspberrypi-kernel-headers make + # - gcc version needs to match "cat /proc/version", currently 4.9.3 on raspberrypi.org Stretch repo + # - This makes the build process currently incompatible with Raspbian Buster: g++-4.9 => g++/gcc v4.9.4 + G_AGI $rpi_firmware raspberrypi-kernel-headers make g++-4.9 apt-mark unhold $rpi_firmware # Should be not required, since we did that on v6.20 patch, but better be failsafe if [[ $old_firmware != $(ls /lib/modules/) ]]; then @@ -2000,10 +2002,14 @@ Once rebooted, please rerun dietpi-config > Audio Options. Re-select the sound c fi + # - /lib/modules/$(uname -r)/source expected, but only .../build included in headers package currently + # - A symlink does the job: https://github.com/notro/rpi-source/blob/master/rpi-source#L340-L341 + [[ -e /lib/modules/$(uname -r)/source ]] || ln -s /lib/modules/$(uname -r)/build /lib/modules/$(uname -r)/source + # - Build dtoverlay mkdir -p i-sabre-k2m_build cd i-sabre-k2m_build - install_url_address='https://dietpi.com/downloads/sourcebuild/I-Sabre-K2M.7z' + install_url_address='https://dietpi.com/downloads/sourcebuild/I-Sabre-K2M.7z' # https://github.com/SatoruKawase/I-Sabre-K2M G_CHECK_URL "$install_url_address" wget "$install_url_address" -O package.7z 7z x -y package.7z From 1f98515dc8443c5a0a08bd1cb56e575b04960fea Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Feb 2019 01:26:30 +0100 Subject: [PATCH 040/232] v6.22 + DietPi-Set_Software | Remove obsolete workaround for archive.raspberrypi.org repo on Buster --- dietpi/func/dietpi-set_software | 3 --- 1 file changed, 3 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index e1919c7ea8..c3c5cecc68 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -132,9 +132,6 @@ $FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi echo "deb https://archive.raspberrypi.org/debian/ $G_DISTRO_NAME main ui" > /etc/apt/sources.list.d/raspi.list - # Highest available raspi.list distro is currently Stretch, working good enough for testing purposes with Raspbian Buster: - (( $G_DISTRO > 4 )) && sed -i "s/$G_DISTRO_NAME/stretch/" /etc/apt/sources.list.d/raspi.list - # Update dietpi.txt entry G_CONFIG_INJECT 'CONFIG_APT_RASPBIAN_MIRROR=' "CONFIG_APT_RASPBIAN_MIRROR=$INPUT_MODE_VALUE" /DietPi/dietpi.txt From e59cc70df2682cb013a693e0d126aeb3b7e7d762 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Feb 2019 01:38:08 +0100 Subject: [PATCH 041/232] v6.22 + DietPi-Patch | Remove obsolete workaround for archive.raspberrypi.org repo on Buster --- dietpi/patch_file | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index ae7091584c..501c26edda 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1657,6 +1657,9 @@ Also have a look at "Sonarr", another alternative TV show manager, available for fi #------------------------------------------------------------------------------- + #Remove obsolete workaround for archive.raspberrypi.org repo on Buster: https://github.com/Fourdee/DietPi/issues/1286#issuecomment-463856159 + (( $G_DISTRO == 5 && $G_HW_MODEL < 10 )) && sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/raspi.list + #------------------------------------------------------------------------------- fi From 649574f6a792ae7833f6e8b71b32ab5640d8ff84 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Feb 2019 16:16:30 +0100 Subject: [PATCH 042/232] v6.22 (#2552) + DietPi-Software | Remot3.it: Fix install due to changed Git repo. Install latest available version via: api.github.com + DietPi-Software | Remot3.it: Now available for ARMv8 and x86_64 as well + CHANGELOG | Remot3.it: Resolved an issue where install failed due to Git repo changes --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 38 +++++++++++++++++++++++--------------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cb4259505a..b60a6da499 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -14,6 +14,7 @@ Bug Fixes: - DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 - DietPi-Software | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed. Thanks to @XRay437 for reporting this issue: https://github.com/Fourdee/DietPi/issues/2545 - DietPi-Software | Java: Resolved an issue where install failed on ARM. Thanks to @WTFMaster for reporting this issue: https://github.com/Fourdee/DietPi/issues/2524 +- DietPi-Software | Remot3.it: Resolved an issue where install failed due to Git repo changes. Additionally Remot3.it is now available on x86_64 and ARMv8 systems as well. Thanks to @techano for reporting this issue: https://github.com/Fourdee/DietPi/issues/2551 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a7fd03b77e..f4ee6cb6c9 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1527,11 +1527,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='(Weaved) access your device over the internet' aSOFTWARE_CATEGORY_INDEX[$software_id]=10 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p188' - - # - Currently ARMv6/7 only - aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 - aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,10]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=188#p188' #------------------ software_id=138 @@ -4336,12 +4332,30 @@ _EOF_ fi - #WEAVED - software_id=68 + software_id=68 # Remot3.it (previously Weaved) if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - Download_Install 'https://github.com/weaved/installer/raw/master/Raspbian%20deb/1.3-07/weavedconnectd_1.3-07z1_armhf.deb' + INSTALL_URL_ADDRESS='https://api.github.com/repos/remoteit/installer/releases/latest' + G_CHECK_URL "$INSTALL_URL_ADDRESS" + + # ARMv6/7 + local arch='armhf' + + # ARMv8 + if (( $G_HW_ARCH == 3 )); then + + arch='arm64' + + # x86_64 + elif (( $G_HW_ARCH == 10 )); then + + arch='amd64' + + fi + + INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*connectd_.*_$arch\.deb" | cut -d \" -f 4) + no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" fi @@ -13489,13 +13503,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - # <= v150 (weaved) - rm -R /etc/weaved - rm -R $HOME/weaved_software - rm $HOME/weaved_setup.bin - - # Remot3.it - G_AGP weavedconnectd + G_AGP connectd weavedconnectd # pre-v6.22 fi From 7c9d752885fd245b4723b88b3fff7e85e95edb39 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 15:21:01 +0000 Subject: [PATCH 043/232] v6.22 #Sudo required for non-root dietpi@DietPi:~$ systemctl status dietpi-postboot Failed to connect to bus: No such file or directory --- dietpi/login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/login b/dietpi/login index ef35f2d400..9bd69e9b63 100644 --- a/dietpi/login +++ b/dietpi/login @@ -159,7 +159,7 @@ Main(){ # Wait for full system boot - until systemctl status dietpi-postboot | grep -qi 'exited' + until sudo systemctl status dietpi-postboot | grep -qi 'exited' #Sudo required for non-root do echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Waiting for DietPi-Postboot to finish, before executing login script...' From c7312937b3b2c395951bb7e93b5debc3f0bd199d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Feb 2019 16:29:14 +0100 Subject: [PATCH 044/232] v6.22 + CHANGELOG | Resolved an issue where I-Sabre-K2M sound card selection failed --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cb4259505a..b9974de2ab 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -10,6 +10,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 +- RPi | Resolved an issue where I-Sabre-K2M sound card selection failed. Thanks to @klasLiesen for reporting this issue: https://github.com/Fourdee/DietPi/issues/2547 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 - DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 - DietPi-Software | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed. Thanks to @XRay437 for reporting this issue: https://github.com/Fourdee/DietPi/issues/2545 From 82fe2a7744ea3e6038ab65139710111e2b73ed19 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 15:44:52 +0000 Subject: [PATCH 045/232] v6.22 + Tweaks --- dietpi/login | 56 +++++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/dietpi/login b/dietpi/login index 9bd69e9b63..5b70f78b63 100644 --- a/dietpi/login +++ b/dietpi/login @@ -104,25 +104,9 @@ # First Run Setup Run_First_Update_Setup(){ - # First run setup running in other session - Other_Session_User_Prompt(){ - - local additional_text='Please resume setup on the active screen.' - (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress, the system will reboot automatically when completed.' - - # Force interactive whiptail - G_USER_INPUTS=1 G_WHIP_MSG "[WARNING] DietPi is currently running on another screen.\n\n$additional_text" - - exit - - } - # 1st run dietpi-update if (( $G_DIETPI_INSTALL_STAGE == 0 )); then - # - Prompt and exit if DietPi-Update runs in other session already - pgrep 'dietpi-update' &> /dev/null && Other_Session_User_Prompt - # - Check internet optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | mawk '{print $2}')" # Will exit on failure here then prompt user to configure network @@ -135,9 +119,6 @@ # 1st run dietpi-software installs elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then - # - Prompt and exit if DietPi-Software runs in other session already - pgrep 'dietpi-software' &> /dev/null && Other_Session_User_Prompt - # - Start DietPi-Software /DietPi/dietpi/dietpi-software 2>&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 @@ -167,14 +148,6 @@ done - # Automated first run setup? - if (( $( /dev/null; then + + # - First run setup running in other session + local additional_text='Please resume setup on the active screen.' + (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted (if required), or, this terminal session will login.' + + G_WHIP_MSG "[WARNING] DietPi first run setup: Currently running on another screen.\n\n$additional_text" + + local restart_loop_delay=5 + G_DIETPI-NOTIFY 2 "Waiting $restart_loop_delay seconds before checking again. Please wait... (Press CTRL+C to abort)" + sleep $restart_loop_delay + + elif (( ! $G_CHECK_ROOT_USER_VERIFIED )); then G_WHIP_MSG '[WARNING] Root login required\n To finish DietPi first run setup, root permissions are required.\n @@ -219,6 +209,10 @@ Please login again as user "root" with password "dietpi", respectively the one y break + else + + Run_First_Update_Setup + fi #---------------------------------------------------------------- From a206e5483fbc17204c50d6ed4005451bb09c0a4a Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 15:48:12 +0000 Subject: [PATCH 046/232] v6.22 + Might also need a failsafe int check --- dietpi/login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/login b/dietpi/login index 5b70f78b63..4492b3e5ea 100644 --- a/dietpi/login +++ b/dietpi/login @@ -189,7 +189,7 @@ fi # - Prompt and wait if this script runs in other session already - if pgrep 'login' &> /dev/null; then + if (( $(pgrep 'login' 2> /dev/null | wc -l) >= 2 )); then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' From a970f39a86a42852057a24e4d5b22cf486bee0d4 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 16:06:48 +0000 Subject: [PATCH 047/232] v6.22 + Count \o/ --- dietpi/login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/login b/dietpi/login index 4492b3e5ea..a7023e537c 100644 --- a/dietpi/login +++ b/dietpi/login @@ -189,7 +189,7 @@ fi # - Prompt and wait if this script runs in other session already - if (( $(pgrep 'login' 2> /dev/null | wc -l) >= 2 )); then + if (( $(pgrep -c 'login') >= 2 )); then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' From ffc3eec4113abd2c6165c12c5426c016cba4ec38 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 16:08:32 +0000 Subject: [PATCH 048/232] v6.22 + Switch to dietpi-login, to ensure pgrep better match --- dietpi/{login => dietpi-login} | 4 ++-- rootfs/etc/bashrc.d/dietpi-login.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename dietpi/{login => dietpi-login} (98%) diff --git a/dietpi/login b/dietpi/dietpi-login similarity index 98% rename from dietpi/login rename to dietpi/dietpi-login index a7023e537c..a1f9f98262 100644 --- a/dietpi/login +++ b/dietpi/dietpi-login @@ -9,7 +9,7 @@ #//////////////////////////////////// # # Info: - # - filename /DietPi/dietpi/login + # - filename /DietPi/dietpi/dietpi-login # - activates on login /etc/bashrc.d/dietpi-login.sh #//////////////////////////////////// @@ -189,7 +189,7 @@ fi # - Prompt and wait if this script runs in other session already - if (( $(pgrep -c 'login') >= 2 )); then + if (( $(pgrep -c 'dietpi-login') >= 2 )); then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' diff --git a/rootfs/etc/bashrc.d/dietpi-login.sh b/rootfs/etc/bashrc.d/dietpi-login.sh index 3d8fbbcaa4..18e76501c1 100644 --- a/rootfs/etc/bashrc.d/dietpi-login.sh +++ b/rootfs/etc/bashrc.d/dietpi-login.sh @@ -4,4 +4,4 @@ . /DietPi/dietpi/func/dietpi-globals # login scripts and banner -/DietPi/dietpi/login +/DietPi/dietpi/dietpi-login From b6bd3b06b5438312fcca15c159837e564ff8e06d Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 16:13:58 +0000 Subject: [PATCH 049/232] v6.22 + Syntax --- dietpi/dietpi-login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index a1f9f98262..7d97bd2fba 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -181,7 +181,7 @@ G_CHECK_ROOT_USER # - Automated first run setup? - grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then + if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then # - Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) export G_USER_INPUTS=0 From af53f73625d7ac1ba35bebe70e721d49ed9fc8a8 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 16:40:45 +0000 Subject: [PATCH 050/232] v6.22 + Minor --- dietpi/dietpi-login | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 7d97bd2fba..bc72dab162 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -195,7 +195,7 @@ local additional_text='Please resume setup on the active screen.' (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted (if required), or, this terminal session will login.' - G_WHIP_MSG "[WARNING] DietPi first run setup: Currently running on another screen.\n\n$additional_text" + G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen.\n\n$additional_text" local restart_loop_delay=5 G_DIETPI-NOTIFY 2 "Waiting $restart_loop_delay seconds before checking again. Please wait... (Press CTRL+C to abort)" @@ -203,7 +203,7 @@ elif (( ! $G_CHECK_ROOT_USER_VERIFIED )); then - G_WHIP_MSG '[WARNING] Root login required\n + G_WHIP_MSG '[ERROR] Root login required\n To finish DietPi first run setup, root permissions are required.\n Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' From d88030a04cb01f1a810d5545c20b4f9f79d06435 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:25:15 +0000 Subject: [PATCH 051/232] v6.22 + Switch to file for already in use detection. --- dietpi/dietpi-login | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index bc72dab162..3078e30c45 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -21,6 +21,7 @@ # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' + FP_DIETPI_FIRSTRUNSETUP_PID='/tmp/.dietpi-login_1st_run_setup' # Autoboot Run_AutoStart(){ @@ -104,6 +105,8 @@ # First Run Setup Run_First_Update_Setup(){ + echo $$ > $FP_DIETPI_FIRSTRUNSETUP_PID + # 1st run dietpi-update if (( $G_DIETPI_INSTALL_STAGE == 0 )); then @@ -124,6 +127,8 @@ fi + [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID + } Show_License(){ @@ -189,7 +194,7 @@ fi # - Prompt and wait if this script runs in other session already - if (( $(pgrep -c 'dietpi-login') >= 2 )); then + if [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]]; then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' From 3ef39bbe92759ff05012e6d0f71ee5d657fa4619 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:26:11 +0000 Subject: [PATCH 052/232] v6.22 + Tweak. --- dietpi/dietpi-login | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 3078e30c45..14c1e433cd 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -125,9 +125,10 @@ # - Start DietPi-Software /DietPi/dietpi/dietpi-software 2>&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 - fi + # - done + [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID - [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID + fi } From d447e3592e11d5b189be64c38e1a7f7bd97c2c09 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:34:51 +0000 Subject: [PATCH 053/232] v6.22 + Further tweaks/clean up --- dietpi/dietpi-login | 108 +++++++++++++++++++++++--------------------- 1 file changed, 56 insertions(+), 52 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 14c1e433cd..8c223e2962 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -21,7 +21,7 @@ # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' - FP_DIETPI_FIRSTRUNSETUP_PID='/tmp/.dietpi-login_1st_run_setup' + FP_DIETPI_FIRSTRUNSETUP_PID='/var/tmp/dietpi/.dietpi-login_1st_run_setup' # Autoboot Run_AutoStart(){ @@ -105,28 +105,64 @@ # First Run Setup Run_First_Update_Setup(){ - echo $$ > $FP_DIETPI_FIRSTRUNSETUP_PID + G_CHECK_ROOT_USER - # 1st run dietpi-update - if (( $G_DIETPI_INSTALL_STAGE == 0 )); then + # - Automated first run setup? + if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then - # - Check internet - optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | mawk '{print $2}')" # Will exit on failure here then prompt user to configure network + # - Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) + export G_USER_INPUTS=0 - # - Check NTP synced - /DietPi/dietpi/func/run_ntpd + fi + + # - Prompt and wait if this script runs in other session already + if [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]]; then + + # - First run setup running in other session + local additional_text='Please resume setup on the active screen.' + (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted (if required), or, this terminal session will login.' + + G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen.\n\n$additional_text" + + local restart_loop_delay=5 + G_DIETPI-NOTIFY 2 "Waiting $restart_loop_delay seconds before checking again. Please wait... (Press CTRL+C to abort)" + sleep $restart_loop_delay + + elif (( ! $G_CHECK_ROOT_USER_VERIFIED )); then + + G_WHIP_MSG '[ERROR] Root login required\n +To finish DietPi first run setup, root permissions are required.\n +Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' - # - Start DietPi-Update - /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 + exit - # 1st run dietpi-software installs - elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then + else - # - Start DietPi-Software - /DietPi/dietpi/dietpi-software 2>&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + # Prevent re-run from another session. + echo $$ > $FP_DIETPI_FIRSTRUNSETUP_PID - # - done - [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID + # 1st run dietpi-update + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then + + # - Check internet + optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | mawk '{print $2}')" # Will exit on failure here then prompt user to configure network + + # - Check NTP synced + /DietPi/dietpi/func/run_ntpd + + # - Start DietPi-Update + /DietPi/dietpi/dietpi-update 1 # Sets G_DIETPI_INSTALL_STAGE=1 + + # 1st run dietpi-software installs + elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then + + # - Start DietPi-Software + /DietPi/dietpi/dietpi-software 2>&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2 + + # - done + [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID + + fi fi @@ -184,42 +220,8 @@ elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then /DietPi/dietpi/func/dietpi-banner 0 - G_CHECK_ROOT_USER - - # - Automated first run setup? - if grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt; then - # - Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) - export G_USER_INPUTS=0 - - fi - - # - Prompt and wait if this script runs in other session already - if [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]]; then - - # - First run setup running in other session - local additional_text='Please resume setup on the active screen.' - (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted (if required), or, this terminal session will login.' - - G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen.\n\n$additional_text" - - local restart_loop_delay=5 - G_DIETPI-NOTIFY 2 "Waiting $restart_loop_delay seconds before checking again. Please wait... (Press CTRL+C to abort)" - sleep $restart_loop_delay - - elif (( ! $G_CHECK_ROOT_USER_VERIFIED )); then - - G_WHIP_MSG '[ERROR] Root login required\n -To finish DietPi first run setup, root permissions are required.\n -Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' - - break - - else - - Run_First_Update_Setup - - fi + Run_First_Update_Setup #---------------------------------------------------------------- # Unknown install state @@ -235,8 +237,10 @@ An error has occured either during first run update or installs.\n First run setup will now attempt to re-apply the last step. If this repeatedly fails, please collect all terminal output and the content of $FP_DIETPI_FIRSTRUNSETUP_LOG if available and report this issue to: https://github.com/Fourdee/DietPi/issues\n\nWould you like to restart the first run setup and installation?"; then - # - reset to 0 to force update and fix code + # - Reset and force re-run of first run + killall -w dietpi-software dietpi-update &> /dev/null echo 0 > /DietPi/dietpi/.install_stage + [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID else From 4113aa7c8d560886024b5aebbdfe2089290eabde Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:35:43 +0000 Subject: [PATCH 054/232] v6.22 + Minor --- dietpi/dietpi-login | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 8c223e2962..524f0141f4 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -103,7 +103,7 @@ } # First Run Setup - Run_First_Update_Setup(){ + Run_DietPi_First_Run_Setup(){ G_CHECK_ROOT_USER @@ -221,7 +221,7 @@ Please login again as user "root" with password "dietpi", respectively the one y /DietPi/dietpi/func/dietpi-banner 0 - Run_First_Update_Setup + Run_DietPi_First_Run_Setup #---------------------------------------------------------------- # Unknown install state From 47f165687650c68401b70f12465f968206c8daf0 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:37:44 +0000 Subject: [PATCH 055/232] v6.22 + Use RAM, in case of reboot, to reset file. --- dietpi/dietpi-login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 524f0141f4..30440369b0 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -21,7 +21,7 @@ # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' - FP_DIETPI_FIRSTRUNSETUP_PID='/var/tmp/dietpi/.dietpi-login_1st_run_setup' + FP_DIETPI_FIRSTRUNSETUP_PID='/tmp/dietpi/.dietpi-login_1st_run_setup' # Autoboot Run_AutoStart(){ From 0d2fede7affcdf3d49e10f2c00d298e344d0f059 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:39:42 +0000 Subject: [PATCH 056/232] v6.22 + Minor --- dietpi/dietpi-login | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 30440369b0..a5eb6a7f6a 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -21,7 +21,7 @@ # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' - FP_DIETPI_FIRSTRUNSETUP_PID='/tmp/dietpi/.dietpi-login_1st_run_setup' + FP_DIETPI_FIRSTRUNSETUP_PID='/tmp/.dietpi-login_1st_run_setup' # Must be on RAM, in case of reboot from dietpi-software etc, to reset file before this script can remove it. # Autoboot Run_AutoStart(){ @@ -134,7 +134,7 @@ To finish DietPi first run setup, root permissions are required.\n Please login again as user "root" with password "dietpi", respectively the one you chose in "dietpi.txt".' - exit + exit 1 else From c8c0f49d7cdecc597ea7ad30a20234075f7b293b Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:41:50 +0000 Subject: [PATCH 057/232] v6.22 + May as well use the info we have :) --- dietpi/dietpi-login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index a5eb6a7f6a..895ceb3a9f 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -122,7 +122,7 @@ local additional_text='Please resume setup on the active screen.' (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted (if required), or, this terminal session will login.' - G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen.\n\n$additional_text" + G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen (PID=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID)).\n\n$additional_text" local restart_loop_delay=5 G_DIETPI-NOTIFY 2 "Waiting $restart_loop_delay seconds before checking again. Please wait... (Press CTRL+C to abort)" From f575476b0950e365649e750f527c1d31748b9d2d Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 17:45:23 +0000 Subject: [PATCH 058/232] v6.22 + Due to re-ordering. --- dietpi/dietpi-login | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 895ceb3a9f..8cf5077b90 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -136,11 +136,14 @@ Please login again as user "root" with password "dietpi", respectively the one y exit 1 + # Proceed with 1st run setup else # Prevent re-run from another session. echo $$ > $FP_DIETPI_FIRSTRUNSETUP_PID + Show_License + # 1st run dietpi-update if (( $G_DIETPI_INSTALL_STAGE == 0 )); then @@ -201,12 +204,12 @@ Please login again as user "root" with password "dietpi", respectively the one y /DietPi/dietpi/func/obtain_network_details - Show_License - #---------------------------------------------------------------- # Normal Login if (( $G_DIETPI_INSTALL_STAGE == 2 )); then + Show_License + /DietPi/dietpi/func/dietpi-banner 1 local auto_start_index=0 From d5f44d4ca0b25e191141266ea6c236aa3f29025e Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 18:05:41 +0000 Subject: [PATCH 059/232] v6.22 + PID check --- dietpi/dietpi-login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 8cf5077b90..d789dac681 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -116,7 +116,7 @@ fi # - Prompt and wait if this script runs in other session already - if [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]]; then + if [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && (( $(cat $FP_DIETPI_FIRSTRUNSETUP_PID) != $$ )); then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' From 0fc5e84af0fca0abb1d1c6a29e610037c94786b9 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 18:55:07 +0000 Subject: [PATCH 060/232] v6.22 Automated always reboots system after software. --- dietpi/dietpi-login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index d789dac681..f95b716502 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -120,7 +120,7 @@ # - First run setup running in other session local additional_text='Please resume setup on the active screen.' - (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted (if required), or, this terminal session will login.' + (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted.' G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen (PID=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID)).\n\n$additional_text" From 74edffd389bdc03b0415a5bc72f2e02d430c7975 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 19:12:36 +0000 Subject: [PATCH 061/232] v6.22 + Minor --- dietpi/dietpi-login | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index f95b716502..bd1f6a027e 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -116,13 +116,15 @@ fi # - Prompt and wait if this script runs in other session already - if [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && (( $(cat $FP_DIETPI_FIRSTRUNSETUP_PID) != $$ )); then + local pid_firstrunsetup='-1' + [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && pid_firstrunsetup=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID) + if (( $pid_firstrunsetup != $$ )); then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' (( ! $G_USER_INPUTS )) && additional_text='Automated setup is in progress. When completed, the system will be rebooted.' - G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen (PID=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID)).\n\n$additional_text" + G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen (PID=$pid_firstrunsetup).\n\n$additional_text" local restart_loop_delay=5 G_DIETPI-NOTIFY 2 "Waiting $restart_loop_delay seconds before checking again. Please wait... (Press CTRL+C to abort)" From f8d1b374421b0b22132610c517b0f196e75cda09 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 19:13:36 +0000 Subject: [PATCH 062/232] v6.22 + More coffee required... --- dietpi/dietpi-login | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index bd1f6a027e..47cdfe135f 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -116,7 +116,7 @@ fi # - Prompt and wait if this script runs in other session already - local pid_firstrunsetup='-1' + local pid_firstrunsetup=-1 [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && pid_firstrunsetup=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID) if (( $pid_firstrunsetup != $$ )); then From 62a6437db8ce10332dd2446aae5f412bb2f3237a Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 15 Feb 2019 19:18:08 +0000 Subject: [PATCH 063/232] v6.22 + Too much coffee maybe? lol --- dietpi/dietpi-login | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 47cdfe135f..4674158b23 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -116,9 +116,9 @@ fi # - Prompt and wait if this script runs in other session already - local pid_firstrunsetup=-1 + local pid_firstrunsetup='' [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && pid_firstrunsetup=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID) - if (( $pid_firstrunsetup != $$ )); then + if [[ $pid_firstrunsetup ]] && (( $pid_firstrunsetup != $$ )); then # - First run setup running in other session local additional_text='Please resume setup on the active screen.' From d07c029b64b6d331efcbfdb0c4f31480c90b43d9 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 14:39:47 +0100 Subject: [PATCH 064/232] META | dietpi-cloud-migration: Minor coding and wording --- .meta/dietpi-cloud-migration | 47 +++++++++++++++--------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/.meta/dietpi-cloud-migration b/.meta/dietpi-cloud-migration index 07142326b4..992fe4e9fd 100644 --- a/.meta/dietpi-cloud-migration +++ b/.meta/dietpi-cloud-migration @@ -1,28 +1,24 @@ #!/bin/bash -(( $UID )) && echo -e '[\e[31mFAILED\e[0m] Root privileges required. Please run the command with "sudo".\n' && exit 1 +(( $UID )) && echo -e '[\e[31mFAILED\e[0m] Root privileges required. Please run the script with "sudo".\n' && exit 1 echo -e '[\e[32m OK \e[0m] Root privileges verified.' -apt-get install -y rsync -(( $? )) && echo -e '[\e[31mFAILED\e[0m] Installation of rsync failed. Please check your internet connection, proper apt-get function or try to install it manually: "apt-get install -y rsync"\n' && exit 1 +! apt-get install -y rsync && echo -e '[\e[31mFAILED\e[0m] "rsync" install failed. Please check your internet connection, proper apt-get function or try to install it manually: "apt-get install -y rsync"\n' && exit 1 echo -e '[\e[32m OK \e[0m] Successfully installed rsync.' run_backup(){ - echo '[ INFO ] Enabling maintenance mode...' - sudo -u www-data php /var/www/$1/occ maintenance:mode --on - (( $? )) && echo -e '[\e[31mFAILED\e[0m] Could not enable maintenance mode, please check running state of your instance and PHP functionality.\n' && exit 1 - fp_config="/var/www/$1/config/config.php" - echo "[ INFO ] Scanning $fp_config for necessary information..." - [[ ! -f $fp_config ]] && echo -e "[\e[31mFAILED\e[0m] File $fp_config not found, please check your installation.\n" && exit 1 + echo '[ INFO ] Enabling maintenance mode...' + ! sudo -u www-data php /var/www/$1/occ maintenance:mode --on && echo -e '[\e[31mFAILED\e[0m] Could not enable maintenance mode, please check running state of your instance and PHP functionality.\n' && exit 1 - local fp_datadir=$(grep -m1 "^[[:blank:]]*'datadirectory'" $fp_config | mawk '{print $3}' | sed "s/[',]//g") - local dbname=$(grep -m1 "^[[:blank:]]*'dbname'" $fp_config | mawk '{print $3}' | sed "s/[',]//g") - local dbhost=$(grep -m1 "^[[:blank:]]*'dbhost'" $fp_config | mawk '{print $3}' | sed "s/[',]//g") - local dbuser=$(grep -m1 "^[[:blank:]]*'dbuser'" $fp_config | mawk '{print $3}' | sed "s/[',]//g") - local dbpass=$(grep -m1 "^[[:blank:]]*'dbpassword'" $fp_config | mawk '{print $3}' | sed "s/[',]//g") + echo "[ INFO ] Scanning $fp_config for necessary information..." + local fp_datadir=$(grep -m1 "^[[:blank:]]*'datadirectory'" $fp_config | cut -d \' -f 4) + local dbname=$(grep -m1 "^[[:blank:]]*'dbname'" $fp_config | cut -d \' -f 4) + local dbhost=$(grep -m1 "^[[:blank:]]*'dbhost'" $fp_config | cut -d \' -f 4) + local dbuser=$(grep -m1 "^[[:blank:]]*'dbuser'" $fp_config | cut -d \' -f 4) + local dbpass=$(grep -m1 "^[[:blank:]]*'dbpassword'" $fp_config | cut -d \' -f 4) echo -e " - data directory: $fp_datadir - database name: $dbname - database hostname: $dbhost @@ -30,50 +26,45 @@ run_backup(){ - database password: $dbpass" echo '[ INFO ] Backup database to data directory...' - mysqldump -u"$dbuser" -h"$dbhost" -p"$dbpass" "$dbname" > "$fp_datadir"/dietpi-$1-database-backup.sql - (( $? )) && echo -e '[\e[31mFAILED\e[0m] Database backup seems to have failed. Check state of your database server, check logs and in case repair table corruptions.\n' && exit 1 + ! mysqldump -u"$dbuser" -h"$dbhost" -p"$dbpass" "$dbname" > "$fp_datadir"/dietpi-$1-database-backup.sql && echo -e '[\e[31mFAILED\e[0m] Database backup failed, please check state of your database server, check logs and in case repair table corruptions.\n' && exit 1 echo -e "[\e[32m OK \e[0m] Successfully finished database backup to: $fp_datadir/dietpi-$1-database-backup.sql" echo '[ INFO ] Backup installation folder to data directory...' - rsync -aHp --delete /var/www/$1/ "$fp_datadir"/dietpi-$1-installation-backup - (( $? )) && echo -e '[\e[31mFAILED\e[0m] Rsync failed, check for error reasons and try again.\n' && exit 1 + ! rsync -aHp --delete /var/www/$1/ "$fp_datadir"/dietpi-$1-installation-backup && echo -e '[\e[31mFAILED\e[0m] "rsync" failed, please check for error reasons and try again.\n' && exit 1 echo -e "[\e[32m OK \e[0m] Successfully finished installation backup to: $fp_datadir/dietpi-$1-installation-backup/" if [[ $2 ]]; then echo '[ INFO ] You provided an additional backup location. Moving data directory...' - [[ ! -d $2 ]] && echo -e "[\e[31mFAILED\e[0m] $2 is no directory, please check spelling and mount status of your desired backup location.\n" && exit 1 + [[ ! -d $2 ]] && echo -e "[\e[31mFAILED\e[0m] $2 is no existing directory, please check spelling and mount status of your desired backup drive.\n" && exit 1 - rsync -aHp --delete "$fp_datadir"/ "$2" - (( $? )) && echo -e '[\e[31mFAILED\e[0m] Rsync failed, check for error reasons and try again.\n' && exit 1 + ! rsync -aHp --delete "$fp_datadir"/ "$2" && echo -e '[\e[31mFAILED\e[0m] "rsync" failed, please check for error reasons and try again.\n' && exit 1 echo -e "[\e[32m OK \e[0m] Successfully synced data directory to: $2" else - echo '[ INFO ] You did not provide an additional backup location. We assume your data directory is already on an external drive, ready for migration? If not, move it there or rerun this script, providing the external backup location as argument.' + echo '[ INFO ] You did not provide an additional backup location. We assume your data directory is already on an external drive, ready for migration? If not, move it there, or, rerun this script with the desired external backup path as argument.' fi - echo -e "[\e[32m OK \e[0m] Backup successfully completed. On destination server, please move the whole data directory to the one, provided within /DietPi/dietpi.txt (default: \"/mnt/dietpi_userdata/$1_data\"), or create a symlink from there. On reinstallation, DietPi-Software will check this location for backups and in case automatically restore them." + echo -e "[\e[32m OK \e[0m] Backup successfully completed. On destination server, please move the whole data directory to the one, provided within /DietPi/dietpi.txt (default: \"/mnt/dietpi_userdata/$1_data\"), or create a symlink from there. On reinstall, DietPi-Software will check this location for backups and in case automatically restore them." } ### MAIN ### -[[ ! -f /DietPi/dietpi/.installed ]] && echo -e '[\e[31mFAILED\e[0m] No proper DietPi installation found or DietPi-RamDisk is not running. Please ensure you are executing this script from a functional DietPi system and "dietpi-ramdisk" is up.\n' && exit 1 - -if grep -q 'aSOFTWARE_INSTALL_STATE\[47\]=2' /DietPi/dietpi/.installed; then +if [[ -f /var/www/owncloud/config/config.php ]]; then echo '[ INFO ] ownCloud installation found, preparing backup...' run_backup owncloud "$1" fi -if grep -q 'aSOFTWARE_INSTALL_STATE\[114\]=2' /DietPi/dietpi/.installed; then +if [[ -f /var/www/nextcloud/config/config.php ]]; then echo '[ INFO ] Nextcloud installation found, preparing backup...' run_backup nextcloud "$1" fi -[[ ! $fp_config ]] && echo -e "[\e[31mFAILED\e[0m] No ownCloud or Nextcloud installation found. Please verify that it was installed via dietpi-software, in case reinstall it, non of your existing data/settings will be overwritten.\n" && exit 1 +[[ ! $fp_config ]] && echo -e '[\e[31mFAILED\e[0m] No ownCloud or Nextcloud instance found at /var/www/owncloud|nextcloud. Aborting...\n' && exit 1 From eb0f4cbc5afd7c98ffacb14ca0ff4f96b1459915 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 14:49:58 +0100 Subject: [PATCH 065/232] META | dietpi-fan_control: Fix G_CHECK_VALIDINT use + minor coding --- .meta/dietpi-fan_control | 52 +++++++++++++--------------------------- 1 file changed, 16 insertions(+), 36 deletions(-) diff --git a/.meta/dietpi-fan_control b/.meta/dietpi-fan_control index 70488023e6..bf99bf2292 100644 --- a/.meta/dietpi-fan_control +++ b/.meta/dietpi-fan_control @@ -62,7 +62,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. INPUT=0 if [[ $@ ]]; then - if G_CHECK_VALIDINT "$@"; then + if disable_error=1 G_CHECK_VALIDINT "$@"; then INPUT=$@ @@ -97,7 +97,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. done # - Remove leading white space - TRIP_TEMPS_CURRENT="${TRIP_TEMPS_CURRENT# }" + TRIP_TEMPS_CURRENT=${TRIP_TEMPS_CURRENT# } # - Read current trip point fan speeds TRIP_SPEEDS_CURRENT='' @@ -109,7 +109,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. done # - Remove leading white space - TRIP_SPEEDS_CURRENT="${TRIP_SPEEDS_CURRENT# }" + TRIP_SPEEDS_CURRENT=${TRIP_SPEEDS_CURRENT# } # - Read current static fan speed # - Convert 0-255 to 0-100% @@ -122,11 +122,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. # - $TRIP_TEMPS='XX YY ZZ'; XX°C YY°C ZZ°C # - $TRIP_SPEEDS='AAA BBB CCC DDD'; AAA*100/255 %... # - $STATIC_SPEED=EEE; EEE*100/255 % - Read_Settings(){ - - . $FP_SETTINGS - - } + Read_Settings(){ . $FP_SETTINGS; } # Verify valid settings, before applying Verify_Settings(){ @@ -153,7 +149,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS. elif (( ! $TEMP_CONTROLLED )); then # - $STATIC_SPEED is expected to be an integer. - if ! G_CHECK_VALIDINT $STATIC_SPEED; then + if ! disable_error=1 G_CHECK_VALIDINT $STATIC_SPEED; then G_DIETPI-NOTIFY 1 "Invalid setting: \$STATIC_SPEED=$STATIC_SPEED" return 1 @@ -236,7 +232,7 @@ _EOF_ done # - Remove leading white space - trip_speeds_target="${trip_speeds_target# }" + trip_speeds_target=${trip_speeds_target# } echo "$trip_speeds_target" > $FP_TRIP_SPEEDS else @@ -266,49 +262,33 @@ _EOF_ Temps_Menu(){ - G_WHIP_DEFAULT_ITEM="$TRIP_TEMPS" + G_WHIP_DEFAULT_ITEM=$TRIP_TEMPS G_WHIP_INPUTBOX "Please enter $TRIP_POINT_COUNT space-separated temperature points in °C. -EG: To have trip points at 35°C, 50°C and 65°C, enter\n \"35 50 65\"" - if (( ! $? )); then - - TRIP_TEMPS="$G_WHIP_RETURNED_VALUE" - - fi +EG: To have trip points at 35°C, 50°C and 65°C, enter\n \"35 50 65\"" && TRIP_TEMPS=$G_WHIP_RETURNED_VALUE } Speeds_Menu(){ - G_WHIP_DEFAULT_ITEM="$TRIP_SPEEDS" + G_WHIP_DEFAULT_ITEM=$TRIP_SPEEDS G_WHIP_INPUTBOX "Please enter $(( $TRIP_POINT_COUNT + 1 )) space-separated fan speeds in % (percent) of the maximum possible speed. EG: To disable the fan below $(( $(<$FP_TRIP_TEMPS) / 1000 ))°C, run it at 45% above, 70% after reaching $(( $(<${FP_TRIP_TEMPS/0_temp/1_temp}) / 1000 ))°C and 95% above $(( $(<${FP_TRIP_TEMPS/0_temp/2_temp}) / 1000 ))°C, enter - \"0 45 70 95\"" - if (( ! $? )); then - - TRIP_SPEEDS="$G_WHIP_RETURNED_VALUE" - - fi + \"0 45 70 95\"" && TRIP_SPEEDS=$G_WHIP_RETURNED_VALUE } Static_Speed_Menu(){ - G_WHIP_DEFAULT_ITEM="$STATIC_SPEED" + G_WHIP_DEFAULT_ITEM=$STATIC_SPEED G_WHIP_INPUTBOX "Please enter the desired static fan speeds in % (percent) of the maximum possible speed. -EG: To run the fan at 50%, enter\n \"60\"" - if (( ! $? )); then - - STATIC_SPEED="$G_WHIP_RETURNED_VALUE" - - fi +EG: To run the fan at 50%, enter\n \"60\"" && STATIC_SPEED=$G_WHIP_RETURNED_VALUE } Reboot_Menu(){ G_WHIP_BUTTON_CANCEL_TEXT='Later' - G_WHIP_YESNO 'Reboot now?\n\nThe system default fan controls are automatically applied after next reboot. Do you want to reboot now?' - if (( ! $? )); then + if G_WHIP_YESNO 'Reboot now?\n\nThe system default fan controls are automatically applied after next reboot. Do you want to reboot now?'; then reboot exit 0 @@ -372,7 +352,7 @@ EG: To run the fan at 50%, enter\n \"60\"" if (( $TEMP_CONTROLLED )); then # - Trip point temperature settings - TRIP_TEMPS="${TRIP_TEMPS:-$TRIP_TEMPS_CURRENT}" + TRIP_TEMPS=${TRIP_TEMPS:-$TRIP_TEMPS_CURRENT} local trip_temps_text='' for i in $TRIP_TEMPS do @@ -383,7 +363,7 @@ EG: To run the fan at 50%, enter\n \"60\"" G_WHIP_MENU_ARRAY+=( 'Temp points' "Selected: $trip_temps_text" ) # - Trip point speed settings - TRIP_SPEEDS="${TRIP_SPEEDS:-$TRIP_SPEEDS_CURRENT}" + TRIP_SPEEDS=${TRIP_SPEEDS:-$TRIP_SPEEDS_CURRENT} local trip_speeds_text='' for i in $TRIP_SPEEDS do @@ -482,7 +462,7 @@ EG: To run the fan at 50%, enter\n \"60\"" # Read settings file, to generate menu entries and use current settings as default. [[ -f $FP_SETTINGS ]] && Read_Settings - while true + while : do Main_Menu From 588b77093de4248b6b28003b2afedc415ef2bc66 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 15:06:36 +0100 Subject: [PATCH 066/232] META | dietpi-survey_report: Add v6.21/22 support; Fix version sorting (6.9 => 6.09); Minor wording --- .meta/dietpi-survey_report | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 39a3235e2c..6cf4d6542b 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -200,8 +200,8 @@ aSOFTWARE_NAME[30]='NoMachine' aSOFTWARE_NAME[31]='Kodi' aSOFTWARE_NAME[32]='YMPD' - aSOFTWARE_NAME[33]='AirSonic' - aSOFTWARE_NAME[34]='SubSonic 6' + aSOFTWARE_NAME[33]='Airsonic' + aSOFTWARE_NAME[34]='Subsonic 6' aSOFTWARE_NAME[35]='SqueezeBox' aSOFTWARE_NAME[36]='SqueezeLite' aSOFTWARE_NAME[37]='Shairport Sync' @@ -221,7 +221,7 @@ aSOFTWARE_NAME[51]='OpenTyrian' aSOFTWARE_NAME[52]='Cuberite' aSOFTWARE_NAME[53]='MineOS' - aSOFTWARE_NAME[54]='Forums' + aSOFTWARE_NAME[54]='phpBB' aSOFTWARE_NAME[55]='Wordpress' aSOFTWARE_NAME[56]='Image Gallery' aSOFTWARE_NAME[57]='BaiKal' @@ -263,14 +263,14 @@ aSOFTWARE_NAME[93]='Pi-hole' aSOFTWARE_NAME[94]='ProFTP' aSOFTWARE_NAME[95]='vsFTPD' - aSOFTWARE_NAME[96]='Samba' + aSOFTWARE_NAME[96]='Samba Server' aSOFTWARE_NAME[97]='OpenVPN' aSOFTWARE_NAME[98]='HaProxy' aSOFTWARE_NAME[99]='EmonPi' aSOFTWARE_NAME[100]='PiJuice' aSOFTWARE_NAME[101]='Log Rotate' aSOFTWARE_NAME[102]='Rsyslog' - aSOFTWARE_NAME[103]='DietPi-Ramlog' + aSOFTWARE_NAME[103]='DietPi-RAMlog' aSOFTWARE_NAME[104]='Dropbear' aSOFTWARE_NAME[105]='OpenSSH Server' aSOFTWARE_NAME[106]='NTP' @@ -435,6 +435,15 @@ aSOFTWARE_NAME6_20[171]='DietPi-NordVPN' aSOFTWARE_NAME6_20[172]='WireGuard' + # - v6.21 + v6.22 + for i in ${!aSOFTWARE_NAME6_20[@]} + do + + aSOFTWARE_NAME6_21[$i]=${aSOFTWARE_NAME6_20[$i]} + aSOFTWARE_NAME6_22[$i]=${aSOFTWARE_NAME6_21[$i]} + + done + Main(){ # Copy files to RAM to speed up grep @@ -443,7 +452,7 @@ [[ -e /tmp/dietpi-survey_report ]] && rm -R /tmp/dietpi-survey_report cp -R /home/dietpi-survey/survey /tmp/dietpi-survey_report - cd /tmp/dietpi-survey_report # so we can remove bad files from disk + cd /tmp/dietpi-survey_report for file in *.txt do @@ -894,7 +903,7 @@

DietPi versions:

- $(for i in "${!aDIETPI_VERSION[@]}"; do echo ""; done | sort -nrk 1.20 -t ' ') + $(for i in "${!aDIETPI_VERSION[@]}"; do echo ""; done | sort -nrk 1.17,1.20 -t ' ')
DietPi v$i ${aDIETPI_VERSION[$i]}
DietPi v${i//6.9/6.09} ${aDIETPI_VERSION[$i]}

Git branches:

From 511fc0df69d91338685fd96f786d4edde15a3482 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 16:03:07 +0100 Subject: [PATCH 067/232] v6.22 + DietPi-Login | Tiny --- dietpi/dietpi-login | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 4674158b23..4f730bc2f5 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -117,7 +117,7 @@ # - Prompt and wait if this script runs in other session already local pid_firstrunsetup='' - [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && pid_firstrunsetup=$(cat $FP_DIETPI_FIRSTRUNSETUP_PID) + [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && pid_firstrunsetup=$(<$FP_DIETPI_FIRSTRUNSETUP_PID) if [[ $pid_firstrunsetup ]] && (( $pid_firstrunsetup != $$ )); then # - First run setup running in other session @@ -187,7 +187,7 @@ Please login again as user "root" with password "dietpi", respectively the one y Main(){ # Wait for full system boot - until sudo systemctl status dietpi-postboot | grep -qi 'exited' #Sudo required for non-root + until sudo systemctl status dietpi-postboot | grep -qi 'exited' # "sudo" required for non-root logins do echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Waiting for DietPi-Postboot to finish, before executing login script...' From cbf611e8fd0b782db5ce3e4da1d31e07e8679744 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 16:27:05 +0100 Subject: [PATCH 068/232] v6.22 + DietPi-Globals | Update defaults to v6.22, minor coding and cleanup --- dietpi/func/dietpi-globals | 78 ++++++++++++++------------------------ 1 file changed, 29 insertions(+), 49 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 5711aacc20..69e630483d 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -57,23 +57,15 @@ #DietPi First-Run Stage | -2 = PREP_SYSTEM/Unknown | -1 = first boot | 0 = 1st run dietpi-update | 1 = 1st run dietpi-software | 2 = completed | 10 = Pre-installed image, converts to 2 during 1st boot G_DIETPI_INSTALL_STAGE=-2 - if [[ -f '/DietPi/dietpi/.install_stage' ]]; then - - G_DIETPI_INSTALL_STAGE=$(&1 1>&2 2>&3) if [[ $password_0 && $password_0 == "$password_1" ]]; then - result="$password_0" + result=$password_0 return_value=0 break @@ -1107,7 +1099,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then # Usage: G_RUN_CMD dothis G_ERROR_HANDLER(){ - [[ $l_message ]] || local l_message="$G_ERROR_HANDLER_COMMAND" + [[ $l_message ]] || local l_message=$G_ERROR_HANDLER_COMMAND #Ok (( $G_ERROR_HANDLER_NO_FAIL )) && G_ERROR_HANDLER_EXITCODE=0 @@ -1135,9 +1127,9 @@ $(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then local preimage_name='n/a' if [[ -r '/DietPi/dietpi/.prep_info' ]]; then - image_creator="$(sed -n 1p /DietPi/dietpi/.prep_info)" + image_creator=$(sed -n 1p /DietPi/dietpi/.prep_info) [[ $image_creator == 0 ]] && image_creator='DietPi Core Team' - preimage_name="$(sed -n 2p /DietPi/dietpi/.prep_info)" + preimage_name=$(sed -n 2p /DietPi/dietpi/.prep_info) fi @@ -1164,7 +1156,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then else - whip_msg+="$G_ERROR_HANDLER_COMMAND" + whip_msg+=$G_ERROR_HANDLER_COMMAND fi @@ -1177,7 +1169,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then # Display optional logfile? if [[ $G_ERROR_HANDLER_ONERROR_FPLOGFILE ]]; then - whip_msg+="$print_logfile_info" + whip_msg+=$print_logfile_info whip_msg+='\n\n' fi @@ -1185,14 +1177,14 @@ $(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then # Display "please report to dietpi", if its one of our programs if [[ $G_PROGRAM_NAME && ! $G_ERROR_HANDLER_INFO_ONLY ]]; then - whip_msg+="$print_report_to_dietpi_info" + whip_msg+=$print_report_to_dietpi_info fi if (( $G_ERROR_HANDLER_ONERROR_EXIT )); then whip_msg+='\n\n' - whip_msg+="$print_unable_to_continue" + whip_msg+=$print_unable_to_continue fi @@ -1239,7 +1231,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then elif [[ $choice == 'Send report' ]]; then send_bugreport=1 - bugreport_id="$(sed -n 5p /DietPi/dietpi/.hw_model)" + bugreport_id=$(sed -n 5p /DietPi/dietpi/.hw_model) fi @@ -1361,13 +1353,13 @@ $print_logfile_info G_CHECK_ROOT_USER 1 - G_ERROR_HANDLER_COMMAND="$@" + G_ERROR_HANDLER_COMMAND=$@ G_ERROR_HANDLER_RETRY=1 while (( $G_ERROR_HANDLER_RETRY )) do - [[ $l_message ]] || local l_message="$G_ERROR_HANDLER_COMMAND" + [[ $l_message ]] || local l_message=$G_ERROR_HANDLER_COMMAND G_DIETPI-NOTIFY -2 "$l_message" $G_ERROR_HANDLER_COMMAND &> /tmp/G_ERROR_HANDLER_COMMAND @@ -1390,7 +1382,7 @@ $print_logfile_info # Prompts user to configure network if $G_USER_INPUTS=1 G_CHECK_URL(){ - local string="$@" + local string=$@ local timeout=${timeout:-5} local retry_max=${retry_max:-3} local optional_cmd_inputs=${optional_cmd_inputs:-} @@ -1508,7 +1500,7 @@ $print_logfile_info #Checks if a file/folder exists G_FILE_EXISTS(){ - G_ERROR_HANDLER_COMMAND="$@" + G_ERROR_HANDLER_COMMAND=$@ G_DIETPI-NOTIFY -2 "Checking for existance: $G_ERROR_HANDLER_COMMAND" @@ -1533,7 +1525,7 @@ $print_logfile_info echo -e "$string" > /tmp/G_ERROR_HANDLER_COMMAND G_ERROR_HANDLER_ONERROR_FPLOGFILE='/tmp/G_ERROR_HANDLER_COMMAND' - G_ERROR_HANDLER_COMMAND="$string" + G_ERROR_HANDLER_COMMAND=$string G_ERROR_HANDLER @@ -1552,7 +1544,7 @@ $print_logfile_info G_CHECK_ROOT_USER 1 - local string="$@" + local string=$@ local force_options='' if (( $G_DISTRO >= 4 )); then @@ -1988,7 +1980,7 @@ $print_logfile_info G_CHECK_FREESPACE(){ local return_value=1 - local input_path="$1" + local input_path=$1 local input_required_space=$2 local available_space=$(df -mP $input_path | sed -n 2p | mawk '{print $4}') local string_output="Free space check: path=$input_path | available=$available_space MB | required=$input_required_space MB" @@ -2093,7 +2085,7 @@ $print_logfile_info if [[ -L $G_FP_DIETPI_USERDATA ]]; then # - Check psyhical location exists and is mounted - fp_actual="$(readlink $G_FP_DIETPI_USERDATA)" + fp_actual=$(readlink -f $G_FP_DIETPI_USERDATA) if ! df -P $fp_actual &> /dev/null; then return_value=1 @@ -2293,17 +2285,6 @@ $print_logfile_info } - #Escape chars to prevent expansion and return value - G_ESCAPE_EXPANSION(){ - - local input="${@//\\/\\\\}"; input="${input//./\\.}"; input="${input//+/\\+}"; input="${input//\*/\\\*}"; input="${input//\?/\\\?}"; input="${input//[/\\[}" - input="${input//\(/\\\(}"; input="${input//\{/\\\{}"; input="${input//^/\\^}"; input="${input//&/\\&}"; input="${input//$/\\$}"; input="${input//|/\\|}" - input="${input//\`/\\\`}" - - echo "$input" - - } - #----------------------------------------------------------------------------------- # DEV tools (Not for public use! All mine! :D) #----------------------------------------------------------------------------------- @@ -2363,13 +2344,12 @@ $print_logfile_info G_CONFIG_INJECT(){ [[ $G_PROGRAM_NAME ]] || local G_PROGRAM_NAME='G_CONFIG_INJECT' - local pattern="${1//\//\\\/}" - # local setting="$(G_ESCAPE_EXPANSION $2)" - local setting="${2//\\/\\\\}"; setting="${setting//./\\.}"; setting="${setting//+/\\+}"; setting="${setting//\*/\\\*}"; setting="${setting//\?/\\\?}"; setting="${setting//[/\\[}" - setting="${setting//\(/\\\(}"; setting="${setting//\{/\\\{}"; setting="${setting//^/\\^}"; setting="${setting//&/\\&}"; setting="${setting//$/\\$}"; setting="${setting//|/\\|}"; setting="${setting//\//\\\/}" - [[ $GCI_NEWLINE == 1 ]] && setting="${setting//\\\\n/\\n}" - local file="$3" - local after="${4//\//\\\/}" + local pattern=${1//\//\\\/} + local setting=${2//\\/\\\\}; setting=${setting//./\\.}; setting=${setting//+/\\+}; setting=${setting//\*/\\\*}; setting=${setting//\?/\\\?}; setting=${setting//[/\\[} + setting=${setting//\(/\\\(}; setting=${setting//\{/\\\{}; setting=${setting//^/\\^}; setting=${setting//&/\\&}; setting=${setting//$/\\$}; setting=${setting//|/\\|}; setting=${setting//\//\\\/} + [[ $GCI_NEWLINE == 1 ]] && setting=${setting//\\\\n/\\n} + local file=$3 + local after=${4//\//\\\/} local error='' syntax_error(){ From d3459e543c24e982db0174898340c3c6ec3b8f4f Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 16:39:57 +0100 Subject: [PATCH 069/232] v6.22 + General | Remove last dot file from GitHub repo, so we don't need to remove it in dietpi-update or take care it matches upstream version --- dietpi/.version | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 dietpi/.version diff --git a/dietpi/.version b/dietpi/.version deleted file mode 100644 index 46b255593b..0000000000 --- a/dietpi/.version +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -G_DIETPI_VERSION_CORE=6 -G_DIETPI_VERSION_SUB=22 -G_DIETPI_VERSION_RC=0 -G_GITBRANCH='master' -G_GITOWNER='Fourdee' From 3dc62bdaec55a717761cf610a35682cb411eda7d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 16:44:50 +0100 Subject: [PATCH 070/232] v6.22 + DietPi-Update | All dot files have been removed from update archive dietpi/ sub dir --- dietpi/dietpi-update | 1 - 1 file changed, 1 deletion(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 69b08c7e57..c2379ee611 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -334,7 +334,6 @@ Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SE rm update.zip # Remove files from Git that are not to be updated on client - rm -R DietPi-"$GITBRANCH_TARGET"/dietpi/.??* rm DietPi-"$GITBRANCH_TARGET"/dietpi/server_version* rm DietPi-"$GITBRANCH_TARGET"/dietpi/pre-patch_file From f38f3242d0c0f465939e5620c96b6e799cb7acde Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Feb 2019 17:12:13 +0100 Subject: [PATCH 071/232] v6.22 + DietPi-PREP | Use G_GITBRANCH/G_GITOWNER to match/override dietpi-globals defaults + DietPi-PREP | Read installed version string to G_* variables from "server_version-6", before removing it, instead of downloading ".version" separately. + DietPi-PREP | The above allows to successfully use G_VERSIONDB_SAVE without having ".version" stored in our Git repo --- PREP_SYSTEM_FOR_DIETPI.sh | 60 ++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 183b1d11e7..d9ef78d48f 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -18,7 +18,8 @@ #Core globals G_PROGRAM_NAME='DietPi-PREP' - GITOWNER=${GITOWNER:-Fourdee} + G_GITOWNER=${GITOWNER:-Fourdee} + unset GITOWNER #------------------------------------------------------------------------------------------------ # Critical checks and pre-reqs, with exit, prior to initial run of script @@ -128,7 +129,7 @@ if WHIP_RETURN=$(whiptail --title "$G_PROGRAM_NAME" --menu 'Please select a Git branch:' --default-item 'master' --ok-button 'Ok' --cancel-button 'Exit' --backtitle "$G_PROGRAM_NAME" 12 80 3 "${aWHIP_BRANCH[@]}" 3>&1 1>&2 2>&3); then - GITBRANCH=$WHIP_RETURN + G_GITBRANCH=$WHIP_RETURN else @@ -139,14 +140,14 @@ unset aWHIP_BRANCH WHIP_RETURN - echo "[ INFO ] Selected Git branch: $GITOWNER/$GITBRANCH" + echo "[ INFO ] Selected Git branch: $G_GITOWNER/$G_GITBRANCH" #------------------------------------------------------------------------------------------------ # DietPi-Globals #------------------------------------------------------------------------------------------------ # - Download # - NB: We'll have to manually handle errors, until DietPi-Globals are successfully loaded. - if ! wget "https://raw.githubusercontent.com/$GITOWNER/DietPi/$GITBRANCH/dietpi/func/dietpi-globals" -O dietpi-globals; then + if ! wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/dietpi/func/dietpi-globals" -O dietpi-globals; then echo -e '[FAILED] Unable to download dietpi-globals. Aborting...\n' exit 1 @@ -508,11 +509,11 @@ G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - INTERNET_ADDRESS="https://github.com/$GITOWNER/DietPi/archive/$GITBRANCH.zip" + INTERNET_ADDRESS="https://github.com/$G_GITOWNER/DietPi/archive/$G_GITBRANCH.zip" G_CHECK_URL "$INTERNET_ADDRESS" G_RUN_CMD wget "$INTERNET_ADDRESS" -O package.zip - [[ -d DietPi-$GITBRANCH ]] && l_message='Cleaning previously extracted files' G_RUN_CMD rm -R "DietPi-$GITBRANCH" + [[ -d DietPi-$G_GITBRANCH ]] && l_message='Cleaning previously extracted files' G_RUN_CMD rm -R "DietPi-$G_GITBRANCH" l_message='Extracting DietPi sourcecode' G_RUN_CMD unzip package.zip rm package.zip @@ -523,41 +524,46 @@ # - HW specific config.txt, boot.ini uEnv.txt if (( $G_HW_MODEL < 10 )); then - G_RUN_CMD mv "DietPi-$GITBRANCH/config.txt" /boot/ + G_RUN_CMD mv "DietPi-$G_GITBRANCH/config.txt" /boot/ elif (( $G_HW_MODEL == 10 )); then - G_RUN_CMD mv "DietPi-$GITBRANCH/boot_c1.ini" /boot/boot.ini + G_RUN_CMD mv "DietPi-$G_GITBRANCH/boot_c1.ini" /boot/boot.ini elif (( $G_HW_MODEL == 11 )); then - G_RUN_CMD mv "DietPi-$GITBRANCH/boot_xu4.ini" /boot/boot.ini + G_RUN_CMD mv "DietPi-$G_GITBRANCH/boot_xu4.ini" /boot/boot.ini elif (( $G_HW_MODEL == 12 )); then - G_RUN_CMD mv "DietPi-$GITBRANCH/boot_c2.ini" /boot/boot.ini + G_RUN_CMD mv "DietPi-$G_GITBRANCH/boot_c2.ini" /boot/boot.ini fi - G_RUN_CMD mv "DietPi-$GITBRANCH/dietpi.txt" /boot/ - G_RUN_CMD mv "DietPi-$GITBRANCH/README.md" /boot/dietpi-README.md - G_RUN_CMD mv "DietPi-$GITBRANCH/CHANGELOG.txt" /boot/dietpi-CHANGELOG.txt + G_RUN_CMD mv "DietPi-$G_GITBRANCH/dietpi.txt" /boot/ + G_RUN_CMD mv "DietPi-$G_GITBRANCH/README.md" /boot/dietpi-README.md + G_RUN_CMD mv "DietPi-$G_GITBRANCH/CHANGELOG.txt" /boot/dietpi-CHANGELOG.txt + + # - Reading version string for later use + G_DIETPI_VERSION_CORE=$(sed -n 1p "DietPi-$G_GITBRANCH/dietpi/server_version-6") + G_DIETPI_VERSION_SUB=$(sed -n 2p "DietPi-$G_GITBRANCH/dietpi/server_version-6") + G_DIETPI_VERSION_RC=$(sed -n 3p "DietPi-$G_GITBRANCH/dietpi/server_version-6") # - Remove server_version* / (pre-)patch_file (downloads fresh from dietpi-update) - rm "DietPi-$GITBRANCH/dietpi/server_version"* - rm "DietPi-$GITBRANCH/dietpi/pre-patch_file" - rm "DietPi-$GITBRANCH/dietpi/patch_file" + rm "DietPi-$G_GITBRANCH/dietpi/server_version"* + rm "DietPi-$G_GITBRANCH/dietpi/pre-patch_file" + rm "DietPi-$G_GITBRANCH/dietpi/patch_file" - l_message='Copy DietPi core files to /boot/dietpi' G_RUN_CMD cp -Rf "DietPi-$GITBRANCH/dietpi" /boot/ - l_message='Copy DietPi rootfs files in place' G_RUN_CMD cp -Rf "DietPi-$GITBRANCH/rootfs"/. / - l_message='Clean download location' G_RUN_CMD rm -R "DietPi-$GITBRANCH" + l_message='Copy DietPi core files to /boot/dietpi' G_RUN_CMD cp -Rf "DietPi-$G_GITBRANCH/dietpi" /boot/ + l_message='Copy DietPi rootfs files in place' G_RUN_CMD cp -Rf "DietPi-$G_GITBRANCH/rootfs"/. / + l_message='Clean download location' G_RUN_CMD rm -R "DietPi-$G_GITBRANCH" l_message='Set execute permissions for DietPi scripts' G_RUN_CMD chmod -R +x /boot/dietpi /var/lib/dietpi/services /etc/cron.*/dietpi G_RUN_CMD systemctl daemon-reload G_RUN_CMD systemctl enable dietpi-ramdisk # - Mount tmpfs - mkdir -p /DietPi + G_RUN_CMD mkdir -p /DietPi G_RUN_CMD mount -t tmpfs -o size=10m tmpfs /DietPi l_message='Starting DietPi-RAMdisk' G_RUN_CMD systemctl start dietpi-ramdisk @@ -994,7 +1000,7 @@ _EOF_ #----------------------------------------------------------------------------------- #Boot Logo - [[ -f /boot/boot.bmp ]] && G_RUN_CMD wget https://github.com/$GITOWNER/DietPi/raw/$GITBRANCH/.meta/images/dietpi-logo_boot.bmp -O /boot/boot.bmp + [[ -f /boot/boot.bmp ]] && G_RUN_CMD wget https://github.com/$G_GITOWNER/DietPi/raw/$G_GITBRANCH/.meta/images/dietpi-logo_boot.bmp -O /boot/boot.bmp #----------------------------------------------------------------------------------- #Bash Profiles @@ -1582,7 +1588,7 @@ This program is free software: you can redistribute it and/or modify it under th This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License along with this program. If not, please see http://www.gnu.org/licenses/' +You should have received a copy of the GNU General Public License along with this program. If not, please see http://www.gnu.org/licenses/ _EOF_ G_DIETPI-NOTIFY 2 'Clearing APT cache' @@ -1609,17 +1615,13 @@ _EOF_ fi - G_DIETPI-NOTIFY 2 'Storing DietPi version ID' + G_DIETPI-NOTIFY 2 'Storing DietPi version info' - G_RUN_CMD wget "https://raw.githubusercontent.com/$GITOWNER/DietPi/$GITBRANCH/dietpi/.version" -O /DietPi/dietpi/.version + G_CONFIG_INJECT 'DEV_GITBRANCH=' "DEV_GITBRANCH=$G_GITBRANCH" /DietPi/dietpi.txt + G_CONFIG_INJECT 'DEV_GITOWNER=' "DEV_GITOWNER=$G_GITOWNER" /DietPi/dietpi.txt - chmod +x /DietPi/dietpi/.version - . /DietPi/dietpi/.version # Reduce sub_version by 1, allows us to create image, prior to release and patch if needed. ((G_DIETPI_VERSION_SUB--)) - - G_CONFIG_INJECT 'DEV_GITBRANCH=' "DEV_GITBRANCH=$GITBRANCH" /DietPi/dietpi.txt - G_CONFIG_INJECT 'DEV_GITOWNER=' "DEV_GITOWNER=$GITOWNER" /DietPi/dietpi.txt G_VERSIONDB_SAVE G_RUN_CMD cp /DietPi/dietpi/.version /var/lib/dietpi/.dietpi_image_version From 80bb15d6ab349cf29a6f09ba0959e07bb64281d0 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 01:10:41 +0100 Subject: [PATCH 072/232] v6.22 + DietPi-Bugreport | Increase max upload size to 20M, our server can effort it + DietPi-Bugreport | Use "ls" with option "-A" instead of "-a" not not list "." and ".." current and parent dirs + DietPi-Bugreport | No double quotes required when declaring commands/file paths with wildcard/asterisk, since they are expanded later when reading back array entries + DietPi-Bugreport | Add all known boot/kernel config files to upload archive + DietPi-Bugreport | Add whole directories instead of their contained files via "/*". This includes hidden files as well and allows simpler syntax without expansion. + DietPi-Bugreport | Write command errors to command out file as well, to derive e.g. missing commands/packages + DietPi-Bugreport | Use "7zr" lightweight standalone 7z archiver to lower dependency from "p7zip-full" to "p7zip" + DietPi-Bugreport | Minor coding, e.g. include INPUT check into menu loop to auto break --- dietpi/dietpi-bugreport | 129 +++++++++++++++++++--------------------- 1 file changed, 62 insertions(+), 67 deletions(-) diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index 8d26806ed7..112549f9fa 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -27,13 +27,13 @@ #Import DietPi-Globals --------------------------------------------------------------- INPUT=0 - disable_error=1 G_CHECK_VALIDINT $1 && INPUT=$1 + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 UNIQUE_ID=$(sed -n 5p /DietPi/dietpi/.hw_model) UPLOAD_FILENAME="$UNIQUE_ID.7z" # - byte - UPLOAD_FILESIZE_LIMIT=10000000 + UPLOAD_FILESIZE_LIMIT=20000000 UPLOAD_FILESIZE=0 SFTP_ADDR='ssh.dietpi.com' @@ -43,28 +43,27 @@ # List of commands we want to run and redirect to upload archive aCOMMAND_LIST=( - 'ls -lha /var/log' 'dpkg -l' + 'ip l' 'ip a' 'ip r' - 'ip l' 'lsusb' 'cat /proc/cpuinfo' 'ps aux' 'blkid' 'mount' 'df -h' - "ls /etc/rc*.d/" + 'ls /etc/rc*.d/' 'cut -d: -f1 /etc/passwd' 'locale' - 'ls -lha /mnt' #dietpi userdata location + 'ls -lAh /mnt' # dietpi_userdata location 'dmesg' 'uname -a' 'lsmod' 'aplay -l' 'aplay -L' - "systemctl status *.service -l" - "systemctl status *.mount -l" + 'systemctl status *.service -l' + 'systemctl status *.mount -l' '/DietPi/dietpi/dietpi-services status' ) @@ -72,38 +71,43 @@ # List of files and folders we want to add to upload archive aFILE_LIST=( - # - command output file + # - aCOMMAND_LIST output file 'CMD_OUT.txt' - # - Git Error file + # - Git error file 'G_ERROR_HANDLER_GITREPORT' - # - logs - "/var/log/*" + # - Logs + '/var/log' - # - DietPi scripts / logs - "/DietPi/*" - '/boot/dietpi.txt' + # - Boot/kernel configs '/boot/config.txt' - "/boot/dietpi/*" - "/tmp/.G*" - "/var/tmp/dietpi/logs/*" + '/boot/cmdline.txt' + '/boot/boot.ini' + '/boot/uEnv.ini' + '/boot/armbianEnv.ini' - # - /var/lib/dietpi - "/var/lib/dietpi/*" + # - DietPi files + '/DietPi' + '/boot/dietpi.txt' + '/boot/dietpi' + '/tmp/.G*' + '/var/lib/dietpi' + '/var/tmp/dietpi' - # - confs + # - Login scripts # - bash shell '/etc/bash.bashrc' - "/etc/bashrc.d/*" + '/etc/bashrc.d' '/root/.bashrc' - "/home/*/.bashrc" + '/home/*/.bashrc' # - login shell '/etc/profile' - "/etc/profile.d/*" + '/etc/profile.d' '/root/.profile' - "/home/*/.profile" + '/home/*/.profile' + # - System '/etc/rc.local' '/etc/X11/xorg.conf' '/etc/asound.conf' @@ -111,16 +115,16 @@ '/etc/wpa_supplicant/wpa_supplicant.conf' '/etc/fstab' '/etc/sysctl.conf' - "/etc/sysctl.d/*" + '/etc/sysctl.d' # - Services - "/etc/init.d/*" - "/etc/systemd/system/*" - "/lib/systemd/system/*" + '/etc/init.d' + '/etc/systemd/system' + '/lib/systemd/system' # - APT '/etc/apt/sources.list' - "/etc/apt/sources.list.d/*" + '/etc/apt/sources.list.d' ) @@ -131,34 +135,33 @@ do echo -e "\n----------\n${aCOMMAND_LIST[$i]}:\n----------" >> CMD_OUT.txt - ${aCOMMAND_LIST[$i]} >> CMD_OUT.txt + ${aCOMMAND_LIST[$i]} &>> CMD_OUT.txt done unset aCOMMAND_LIST # - Have the git error in 1st directory. - cp /tmp/.G_ERROR_HANDLER_GITREPORT ./G_ERROR_HANDLER_GITREPORT &> /dev/null + [[ -f /tmp/.G_ERROR_HANDLER_GITREPORT ]] && cp /tmp/.G_ERROR_HANDLER_GITREPORT ./G_ERROR_HANDLER_GITREPORT G_DIETPI-NOTIFY 2 'Packing upload archive, please wait...' - 7z a -t7z -spf "$UPLOAD_FILENAME" ${aFILE_LIST[@]} &> /tmp/dietpi-bugreport_compress.log + 7zr a -spf "$UPLOAD_FILENAME" ${aFILE_LIST[@]} &> dietpi-bugreport_compress.log } Upload_Bug_Report(){ # Check upload location is online - G_CHECK_URL "$SFTP_ADDR" - if (( ! $? )); then + if G_CHECK_URL "$SFTP_ADDR"; then if [[ ! -f $UPLOAD_FILENAME ]]; then G_WHIP_MSG "Failed to create compressed upload file: $UPLOAD_FILENAME\n\nOn the next screen you will be prompted to view the log. If problems persist, please contact DietPi for support." - log=1 G_WHIP_VIEWFILE /tmp/dietpi-bugreport_compress.log + log=1 G_WHIP_VIEWFILE dietpi-bugreport_compress.log exit 1 fi - rm /tmp/dietpi-bugreport_compress.log &> /dev/null + [[ -f dietpi-bugreport_compress.log ]] && rm dietpi-bugreport_compress.log # Limit filesize UPLOAD_FILESIZE=$(stat -c%s "$UPLOAD_FILENAME") @@ -167,8 +170,7 @@ if (( $UPLOAD_FILESIZE <= $UPLOAD_FILESIZE_LIMIT )); then G_DIETPI-NOTIFY -2 'Running cURL' - curl --connect-timeout 4 --retry 1 --retry-delay 4 -sT "$UPLOAD_FILENAME" sftp://"$SFTP_USER":"$SFTP_PASS"@"$SFTP_ADDR"/bugreport/ - if (( ! $? )); then + if curl --connect-timeout 4 --retry 1 --retry-delay 4 -sT "$UPLOAD_FILENAME" sftp://"$SFTP_USER":"$SFTP_PASS"@"$SFTP_ADDR"/bugreport/; then # Bug report removal via empty file upload if (( $UPLOAD_FILESIZE == 0 )); then @@ -208,57 +210,50 @@ # Main Loop #///////////////////////////////////////////////////////////////////////////////////// # Interactive menu - if (( $INPUT == 0 )); then + while (( $INPUT == 0 )) + do - while true - do - - G_WHIP_MENU_ARRAY=( + G_WHIP_MENU_ARRAY=( - '1' ': Send bug report archive to help the developers investigate an issue.' - '2' ': Remove my previous uploaded bug report.' - '3' ': Show me what is included with the upload archive.' + '1' ': Send bug report archive to help the developers investigate an issue.' + '2' ': Remove my previous uploaded bug report.' + '3' ': Show me what is included with the upload archive.' - ) + ) - G_WHIP_MENU "By sending a bug report file, you can help the developers to investigate your issue, in relation to your report on GitHub or the DietPi forum. + if G_WHIP_MENU "By sending a bug report file, you can help the developers to investigate your issue, in relation to your report on GitHub or the DietPi forum. The file is sent via secured connection to our SFTP server and is stored there unreadable to the public upload user. The file will be removed after your issue is solved and you can remove it by yourself as well by running \"dietpi-bugreport -1\" or via this menu. -Would you like to send a bug report archive or remove an already uploaded one?" - if (( ! $? )); then +Would you like to send a bug report archive or remove an already uploaded one?"; then - if (( $G_WHIP_RETURNED_VALUE == 1 )); then + if (( $G_WHIP_RETURNED_VALUE == 1 )); then - INPUT=1 - break + INPUT=1 - elif (( $G_WHIP_RETURNED_VALUE == 2 )); then + elif (( $G_WHIP_RETURNED_VALUE == 2 )); then - INPUT=-1 - break + INPUT=-1 - elif (( $G_WHIP_RETURNED_VALUE == 3 )); then + elif (( $G_WHIP_RETURNED_VALUE == 3 )); then - G_WHIP_SCROLLBOX "The upload will contain the following command outputs: + G_WHIP_SCROLLBOX "The upload will contain the following command outputs: $(printf "\t- %s\n" "${aCOMMAND_LIST[@]}") -It will contain as well the following file locations: +It will contain as well the following files and directories: $(printf "\t- %s\n" "${aFILE_LIST[@]}")" - fi - - else + fi - break + else - fi + break - done + fi - fi + done if (( $INPUT == 1 || $INPUT == -1 )); then From da4492bee864ce90e474e2d2cd0ae3c29c7a5093 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 01:23:02 +0100 Subject: [PATCH 073/232] v6.22 + DietPi-Patch | Remove dependency on "p7zip-full", assure "p7zip" install instead --- dietpi/patch_file | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 501c26edda..76dbb2324c 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1660,6 +1660,10 @@ Also have a look at "Sonarr", another alternative TV show manager, available for #Remove obsolete workaround for archive.raspberrypi.org repo on Buster: https://github.com/Fourdee/DietPi/issues/1286#issuecomment-463856159 (( $G_DISTRO == 5 && $G_HW_MODEL < 10 )) && sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/raspi.list #------------------------------------------------------------------------------- + #Removed dependency on "p7zip-full", use "7zr" (p7zip) instead: https://github.com/Fourdee/DietPi/pull/2559 + dpkg-query -s p7zip-full &> /dev/null && apt-mark auto p7zip-full + G_AGI p7zip + #------------------------------------------------------------------------------- fi From 22a85eb2dc70d39573d04a821617a758a4622ebc Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 01:25:20 +0100 Subject: [PATCH 074/232] v6.22 + DietPi-Set_Hardware | Use standalone lightweight "7zr" to handle 7z archives --- dietpi/func/dietpi-set_hardware | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index fbb0eabd85..695b810e87 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -2006,7 +2006,7 @@ Once rebooted, please rerun dietpi-config > Audio Options. Re-select the sound c install_url_address='https://dietpi.com/downloads/sourcebuild/I-Sabre-K2M.7z' G_CHECK_URL "$install_url_address" wget "$install_url_address" -O package.7z - 7z x -y package.7z + 7zr x -y package.7z rm package.7z G_RUN_CMD make From d95364f4af2b18e63c2bc5310b21f616d9cbd6e2 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 01:27:40 +0100 Subject: [PATCH 075/232] v6.22 + DietPi-PREP | Reduced "p7zip-full" dependency to "p7zip" --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 183b1d11e7..48c6efbdf5 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -638,7 +638,7 @@ _EOF_ 'kmod' # "modprobe", "lsmod", used by several DietPi scripts 'locales' # Support locales, necessary for DietPi scripts, as we use en_GB.UTF8 as default language 'nano' # Simple text editor - 'p7zip-full' # .7z wrapper + 'p7zip' # .7z wrapper 'parted' # Drive partitioning, required by DietPi-Boot + DietPi-Drive_Manager 'procps' # "kill", "ps", "pgrep", "sysctl", used by several DietPi scripts 'psmisc' # "killall", used by several DietPi scripts From a1ed33bd6562f5d1b3ee0f0ef962c0b83525d46a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 01:35:04 +0100 Subject: [PATCH 076/232] v6.22 + DietPi-Software | Use lightweight standalone "7zr" to handle 7z archives --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f4ee6cb6c9..7db701995f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3147,7 +3147,7 @@ _EOF_ elif [[ $type == 7z ]]; then [[ $target ]] && target="-o$target" - l_message='Extracting 7zip archive' G_RUN_CMD 7za x -y $file $target + l_message='Extracting 7zip archive' G_RUN_CMD 7zr x -y $file $target else From 98a223c7dcebced657e531213ab3641340342806 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 01:42:01 +0100 Subject: [PATCH 077/232] v6.22 + CHANGELOG | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b60a6da499..72e36a82a5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v6.22 (xx/02/19) Changes / Improvements / Optimisations: +- General | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives. This allows us to lower DietPi core dependencies from "p7zip-full" to "p7zip". - DietPi-NordVPN | Added sent/recieved usage stats for VPN tunnel. - DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 From 0445816193b01edc8ddfd36d33870dcba6129512 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 02:54:40 +0100 Subject: [PATCH 078/232] v6.22 + DietPi-FS_partition_resize | Tiny: Remove obsolete "RemainAfterExit=no" as this is default and would not harm anyway --- rootfs/etc/systemd/system/dietpi-fs_partition_resize.service | 1 - 1 file changed, 1 deletion(-) diff --git a/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service b/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service index 572445179c..74830cb128 100644 --- a/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service +++ b/rootfs/etc/systemd/system/dietpi-fs_partition_resize.service @@ -8,7 +8,6 @@ Before=var-swap.swap swap.target local-fs-pre.target [Service] Type=oneshot -RemainAfterExit=no StandardOutput=tty ExecStartPre=/bin/mkdir -p /var/tmp/dietpi/logs ExecStart=/bin/bash -c '/var/lib/dietpi/services/fs_partition_resize.sh 2>&1 | tee /var/tmp/dietpi/logs/fs_partition_resize.log' From 8d4829fb477b48e98133d95dac6a79b5fcc14b10 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 14:14:10 +0100 Subject: [PATCH 079/232] v6.22 (#2525) + DietPi-Software | Emby Server: Install latest version via "api.github.com", which now offers native ARMv8 packages as well + CHANGELOG | Emby Server: Now installs the latest version automatically + CHANGELOG | Remove doubled "additional issues" entry. Keep this only in most current version, same as "Known/Outstanding Issues". + DietPi-Software | Emby Server: Drop ARM support on Jessie due to libc6 version requirement + CHANGELOG | Emby Server: Add info about disabled install option on Jessie ARM systems --- CHANGELOG.txt | 4 ++-- dietpi/dietpi-software | 42 ++++++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b60a6da499..16eb96bd8e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,12 +4,14 @@ v6.22 Changes / Improvements / Optimisations: - DietPi-NordVPN | Added sent/recieved usage stats for VPN tunnel. +- DietPi-Software | Emby Server: Now installs the latest version automatically (currently 4.0.1), which as well offers a native ARMv8 package: https://github.com/Fourdee/DietPi/pull/2525 - DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 +- DietPi-Software | Emby Server: We disabled the option to install it on Jessie ARM systems. This was never possible, since Debian Jessie does not provide the minimum required libc6 version. Thanks to @mbone for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5502 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 - DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 - DietPi-Software | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed. Thanks to @XRay437 for reporting this issue: https://github.com/Fourdee/DietPi/issues/2545 @@ -49,8 +51,6 @@ Bug Fixes: As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster -For all additional issues that may appear after release, please see the following link and select the 'Next Version Milestone' to see active tickets: https://github.com/Fourdee/DietPi/milestones - ----------------------------------------------------------------------------------------------------------- v6.20 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f4ee6cb6c9..ad5c73be08 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -648,11 +648,14 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=1789#p1789' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1789#p1789' - # - Disable for ARM6: https://github.com/Fourdee/DietPi/issues/534#issuecomment-416405968 + # - Disable for ARMv6: https://github.com/Fourdee/DietPi/issues/534#issuecomment-416405968 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 + # - Disable for all ARM on Jessie: https://github.com/Fourdee/DietPi/issues/2521 + (( $G_DISTRO < 4 )) && aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,2]=0 && aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 + #------------------ software_id=42 @@ -660,7 +663,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=1949#p1949' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1949#p1949' # - Disable for ARMv6: https://github.com/Fourdee/DietPi/issues/648 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -672,7 +675,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='mumble voip server' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=1691#p1691' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1691#p1691' #------------------ software_id=118 @@ -724,7 +727,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='feature-rich, web interface audio player for mpd' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=5171#p5171' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=5171#p5171' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 @@ -741,7 +744,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=6526#p6526' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6526#p6526' # - VM aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,20]=0 @@ -5212,28 +5215,27 @@ _EOF_ Banner_Installing - G_CHECK_URL 'https://github.com/MediaBrowser' + INSTALL_URL_ADDRESS='https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest' + G_CHECK_URL "$INSTALL_URL_ADDRESS" - #X86_64 - if (( $G_HW_ARCH == 10 )); then + # ARMv7 + local arch='armhf' - no_check_url=1 Download_Install 'https://github.com/MediaBrowser/Emby.Releases/releases/download/3.5.2.0/emby-server-deb_3.5.2.0_amd64.deb' + # ARMv8 + if (( $G_HW_ARCH == 3 )); then - #ARM - else + arch='arm64' - #ARMv8 - if (( $G_HW_ARCH == 3 )); then + # x86_64 + elif (( $G_HW_ARCH == 10 )); then - dpkg --add-architecture armhf - G_AGUP - G_AGI gcc-6-base:armhf libc6:armhf libgcc1:armhf zlib1g:armhf + arch='amd64' - fi + fi - no_check_url=1 Download_Install 'https://github.com/MediaBrowser/Emby.Releases/releases/download/3.5.2.0/emby-server-deb_3.5.2.0_armhf.deb' + no_check_url=1 Download_Install "$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*emby-server-deb_.*_$arch\.deb" | cut -d \" -f 4)" - fi + unset arch fi From 6768f9ae972d21bb7c0df7e1bf22ece28190c54d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Feb 2019 15:00:59 +0100 Subject: [PATCH 080/232] v6.22 (#2562) + DietPi-Software | Koel/MineOS: Fix install on ARMv8 systems, where "n" command explicitly requires "-a arm64" + CHANGELOG | MineOS/Koel: Resolved an issue where install on ARMv8 devices failed --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 16eb96bd8e..aae500e3d8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -11,6 +11,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 +- DietPi-Software | MineOS/Koel: Resolved an issue where install on ARMv8 devices failed. Many thanks to @DeathIsUnknown for reporting this issue and solution: https://github.com/Fourdee/DietPi/issues/1880#issuecomment-464097174 - DietPi-Software | Emby Server: We disabled the option to install it on Jessie ARM systems. This was never possible, since Debian Jessie does not provide the minimum required libc6 version. Thanks to @mbone for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5502 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 - DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ad5c73be08..314565de17 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5313,11 +5313,11 @@ _EOF_ Banner_Installing - #check folder is online + # Check folder is online INSTALL_URL_ADDRESS='https://github.com/hexparrot/mineos-node.git' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #prereqs + # Pre-reqs G_AGI python python3 supervisor rdiff-backup screen rsync mkdir -p $G_FP_DIETPI_USERDATA/mineos @@ -5328,9 +5328,12 @@ _EOF_ git config core.filemode false chmod +x service.js mineos_console.js generate-sslcert.sh webui.js - #Install Node 8, as MineOS is currently not compatible with Node 10 + # Install Node 8, as MineOS is currently not compatible with Node 10: https://github.com/Fourdee/DietPi/issues/1880 npm i -g --unsafe-perm n - n 8 + # - On ARMv8 explicitly add arch info, since it is not recognized by "n": https://github.com/Fourdee/DietPi/issues/1880#issuecomment-464097174 + local arch='' + (( $G_HW_ARCH == 3 )) && arch='-a arm64' + n $arch 8 npm i --unsafe-perm @@ -5758,7 +5761,10 @@ _EOF_ # Install pre-req yarn and "n" to downgrade to Node 8, as Node 10 is not (yet) compatible with Koel build. npm i -g --unsafe-perm yarn n - n 8 + # - On ARMv8 explicitly add arch info, since it is not recognized by "n": https://github.com/Fourdee/DietPi/issues/1880#issuecomment-464097174 + local arch='' + (( $G_HW_ARCH == 3 )) && arch='-a arm64' + n $arch 8 # Download and install Composer: php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php From 347644a8f968614d9f39a199b0f02002c9cb0b05 Mon Sep 17 00:00:00 2001 From: lwqcz <39486334+lwqcz@users.noreply.github.com> Date: Sun, 17 Feb 2019 15:33:00 +0100 Subject: [PATCH 081/232] Update to get correct CPU temp Update to get correct CPU temperature reading on Pine64 with sunxi64 based kernel. As it gives temperature multiplied by 1000 and this value is integer instead of float. Just a minor change. --- dietpi/func/dietpi-globals | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 5711aacc20..02b437c01c 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1922,11 +1922,11 @@ $print_logfile_info fi # - Boards that provide 2 digit output - # Pine + # Pine (when using sunxi64 kernel thermal_zone gives 1000*temp_value) # NanoPi M2 # H3 3.x # H2+ 3.x - if (( $G_HW_MODEL == 40 || + if (( ($G_HW_MODEL == 40 && $(uname -r | awk -F '-' '{ print $2 }') != 'sunxi64') || $G_HW_MODEL == 61 || ( $G_HW_CPUID == 1 && $(uname -r | grep -ci -m1 '^3.') ) || ( $G_HW_MODEL == 32 && $(uname -r | grep -ci -m1 '^3.') ) )); then From 059595d833c67e12c44a0da9d5ed1593acac5e36 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 18 Feb 2019 12:02:06 +0100 Subject: [PATCH 082/232] v6.22 + DietPi-Start_kodi | Do not load DietPi-Globals, since G_HW_MODEL is required only --- dietpi/misc/start_kodi | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dietpi/misc/start_kodi b/dietpi/misc/start_kodi index c157fd6864..e17c8a1252 100644 --- a/dietpi/misc/start_kodi +++ b/dietpi/misc/start_kodi @@ -17,8 +17,8 @@ # - /DietPi/dietpi/misc/start_kodi #//////////////////////////////////// #Import DietPi-Globals --------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Start_kodi' + # G_HW_MODEL required only + G_HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) ##Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -35,7 +35,7 @@ else #From Desktop - if [ "$DISPLAY" ]; then + if [[ $DISPLAY ]]; then #C2 fix for stuttering and laggy audio: https://github.com/Fourdee/DietPi/issues/399#issuecomment-229413994 if (( $G_HW_MODEL == 12 )); then @@ -57,7 +57,6 @@ fi #----------------------------------------------------------------------------------- - #exit exit #----------------------------------------------------------------------------------- -} \ No newline at end of file +} From 4e86b9e660610becd867184ea92459c99962ea36 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 19 Feb 2019 20:27:14 +0000 Subject: [PATCH 083/232] v6.22 - DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service, to ensure the MPD user can use both dietpi and audio groups: https://github.com/Fourdee/DietPi/issues/2462 --- .conf/dps_128/mpd.conf | 4 ++-- CHANGELOG.txt | 1 + dietpi/dietpi-software | 4 +++- dietpi/patch_file | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.conf/dps_128/mpd.conf b/.conf/dps_128/mpd.conf index 64ae79f22f..7a085d27eb 100644 --- a/.conf/dps_128/mpd.conf +++ b/.conf/dps_128/mpd.conf @@ -6,8 +6,8 @@ pid_file "/var/run/mpd/pid" state_file "/mnt/dietpi_userdata/.mpd_cache/state" sticker_file "/mnt/dietpi_userdata/.mpd_cache/sticker.sql" -user "mpd" -group "dietpi" +#user "mpd" #Set via service to allow for mpd user to use assigned groups "audio" and "dietpi" +#group "dietpi" #Set via service to allow for mpd user to use assigned groups "audio" and "dietpi" bind_to_address "localhost" diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c13b2c5fc8..102ca8f0fc 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,7 @@ Bug Fixes: - DietPi-Software | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed. Thanks to @XRay437 for reporting this issue: https://github.com/Fourdee/DietPi/issues/2545 - DietPi-Software | Java: Resolved an issue where install failed on ARM. Thanks to @WTFMaster for reporting this issue: https://github.com/Fourdee/DietPi/issues/2524 - DietPi-Software | Remot3.it: Resolved an issue where install failed due to Git repo changes. Additionally Remot3.it is now available on x86_64 and ARMv8 systems as well. Thanks to @techano for reporting this issue: https://github.com/Fourdee/DietPi/issues/2551 +- DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service, to ensure the MPD user can use both dietpi and audio groups: https://github.com/Fourdee/DietPi/issues/2462 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 42ccfed939..0a3696af95 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8418,7 +8418,9 @@ Documentation=file:///usr/share/doc/mpd/user-manual.html After=network.target sound.target [Service] -#User=mpd # Forks its own process under user set in /etc/mpd.conf (mpd) +User=mpd +#Group=dietpi # Do not change, use system assigned groups, requires both dietpi and audio groups +PermissionsStartOnly=true RuntimeDirectory=/var/run/mpd ExecStartPre=$(command -v mkdir) -p /var/run/mpd ExecStartPre=$(command -v chown) -R mpd:dietpi /var/run/mpd diff --git a/dietpi/patch_file b/dietpi/patch_file index 76dbb2324c..77e501c344 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1664,6 +1664,10 @@ Also have a look at "Sonarr", another alternative TV show manager, available for dpkg-query -s p7zip-full &> /dev/null && apt-mark auto p7zip-full G_AGI p7zip #------------------------------------------------------------------------------- + # - Reinstalls + # MPD: https://github.com/Fourdee/DietPi/issues/2462 + (( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-software reinstall 128 + #------------------------------------------------------------------------------- fi From c1cda33b07568ca5a289c4a93b4c0d1e2a44a45d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 20 Feb 2019 03:09:52 +0100 Subject: [PATCH 084/232] v6.22 + DietPi-Set_Hardware | I-Sabre-K2M: "gcc-4.9" should be sufficient for build + DietPi-Set_Hardware | I-Sabre-K2M: Add correct gcc binary to make commands --- dietpi/func/dietpi-set_hardware | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index ddd76912e8..614e0a6939 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1990,7 +1990,7 @@ _EOF_ G_AGUP # - gcc version needs to match "cat /proc/version", currently 4.9.3 on raspberrypi.org Stretch repo # - This makes the build process currently incompatible with Raspbian Buster: g++-4.9 => g++/gcc v4.9.4 - G_AGI $rpi_firmware raspberrypi-kernel-headers make g++-4.9 + G_AGI $rpi_firmware raspberrypi-kernel-headers make gcc-4.9 apt-mark unhold $rpi_firmware # Should be not required, since we did that on v6.20 patch, but better be failsafe if [[ $old_firmware != $(ls /lib/modules/) ]]; then @@ -2015,10 +2015,10 @@ Once rebooted, please rerun dietpi-config > Audio Options. Re-select the sound c 7z x -y package.7z rm package.7z - G_RUN_CMD make - G_RUN_CMD make modules_install - G_RUN_CMD make dtbs - G_RUN_CMD make install_dtbo + G_RUN_CMD make CC=gcc-4.9 + G_RUN_CMD make CC=gcc-4.9 modules_install + G_RUN_CMD make CC=gcc-4.9 dtbs + G_RUN_CMD make CC=gcc-4.9 install_dtbo cd /tmp/$G_PROGRAM_NAME rm -R i-sabre-k2m_build From 9462a008f25f269eda421913f3c559abef0d48f2 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 20 Feb 2019 03:15:58 +0100 Subject: [PATCH 085/232] v6.22 + DietPi-Set_Hardware | I-Sabre-K2M: Minor comment fix --- dietpi/func/dietpi-set_hardware | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 614e0a6939..0124eab9f7 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1989,7 +1989,7 @@ _EOF_ local rpi_firmware='raspberrypi-bootloader raspberrypi-kernel libraspberrypi-bin libraspberrypi0' G_AGUP # - gcc version needs to match "cat /proc/version", currently 4.9.3 on raspberrypi.org Stretch repo - # - This makes the build process currently incompatible with Raspbian Buster: g++-4.9 => g++/gcc v4.9.4 + # - This makes the build process currently incompatible with Raspbian Buster: gcc-4.9 => v4.9.4 G_AGI $rpi_firmware raspberrypi-kernel-headers make gcc-4.9 apt-mark unhold $rpi_firmware # Should be not required, since we did that on v6.20 patch, but better be failsafe From 30768a47ec49496d33cd2e853c6889b04c2b82ff Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Wed, 20 Feb 2019 18:39:00 +0000 Subject: [PATCH 086/232] v6.22 + Fix CPU temp readout + simplify code. --- dietpi/func/dietpi-globals | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 8d14301408..0e1e093021 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1913,23 +1913,8 @@ $print_logfile_info fi - # - Boards that provide 2 digit output - # Pine (when using sunxi64 kernel thermal_zone gives 1000*temp_value) - # NanoPi M2 - # H3 3.x - # H2+ 3.x - if (( ($G_HW_MODEL == 40 && $(uname -r | awk -F '-' '{ print $2 }') != 'sunxi64') || - $G_HW_MODEL == 61 || - ( $G_HW_CPUID == 1 && $(uname -r | grep -ci -m1 '^3.') ) || - ( $G_HW_MODEL == 32 && $(uname -r | grep -ci -m1 '^3.') ) )); then - - echo 'Do nothing' &> /dev/null - - else - - cpu_temp_current=$(mawk '{print $1/1000}' <<< "$cpu_temp_current" | xargs printf "%0.0f") - - fi + # - 2/5 digit output? + (( $cpu_temp_current >= 150 )) && cpu_temp_current=$(mawk '{print $1/1000}' <<< "$cpu_temp_current" | xargs printf "%0.0f") # - Native PC + possibily others, due to vast sensors /sys/class/thermal/thermal_zone[0-9], all of which we are unsure is CPU, check for possible invalid entries and set N/A # EG: Z83 = 0, also seen some results as a minus value From 816c8503fcf38c6a243e731824439684d8cf41ce Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 22 Feb 2019 20:19:46 +0100 Subject: [PATCH 087/232] v6.22 (#2570) + DietPi-Set_Software | setpermissions: Add Pi-hole Git based permissions reset to allow "pihole -up" + DietPi-Patch | Fix Pi-hole permissions to allow "pihole -up" + CHANGELOG | Pi-hole: Resolved an issue where "pihole -up" fails because of wrong file permissions --- CHANGELOG.txt | 1 + dietpi/func/dietpi-set_software | 9 +++++++++ dietpi/patch_file | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b90ec40eb5..58fb024fe1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -20,6 +20,7 @@ Bug Fixes: - DietPi-Software | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed. Thanks to @XRay437 for reporting this issue: https://github.com/Fourdee/DietPi/issues/2545 - DietPi-Software | Java: Resolved an issue where install failed on ARM. Thanks to @WTFMaster for reporting this issue: https://github.com/Fourdee/DietPi/issues/2524 - DietPi-Software | Remot3.it: Resolved an issue where install failed due to Git repo changes. Additionally Remot3.it is now available on x86_64 and ARMv8 systems as well. Thanks to @techano for reporting this issue: https://github.com/Fourdee/DietPi/issues/2551 +- DietPi-Software | Pi-hole: Resolved an issue where "pihole -up" fails because of wrong file permissions. Thanks to @jonare77 for resporting this issue: https://github.com/Fourdee/DietPi/issues/2516 - DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service, to ensure the MPD user can use both dietpi and audio groups: https://github.com/Fourdee/DietPi/issues/2462 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/Fourdee/DietPi/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+base%3Amaster diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index c3c5cecc68..f2ad4a23c2 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -467,6 +467,15 @@ _EOF_ # - Blynk chown -R blynk:dietpi $G_FP_DIETPI_USERDATA/blynk + # - Pi-hole + # - NB: Git requies special permissions to allow "pihole -up". + if [[ -d /var/www/html/pihole ]]; then + + cd /var/www/html/admin && git reset --hard HEAD + cd /tmp/$G_PROGRAM_NAME + + fi + } #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/patch_file b/dietpi/patch_file index 77e501c344..f845457ed2 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1668,6 +1668,14 @@ Also have a look at "Sonarr", another alternative TV show manager, available for # MPD: https://github.com/Fourdee/DietPi/issues/2462 (( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-software reinstall 128 #------------------------------------------------------------------------------- + #Fix Pi-hole permissions to allow "pihole -up" + if [[ -d /var/www/html/pihole ]]; then + + cd /var/www/html/admin && git reset --hard HEAD + cd /tmp/$G_PROGRAM_NAME + + fi + #------------------------------------------------------------------------------- fi From 4c6a3bc8fa81ad1bd8038b7f51d196271b5e5fea Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 22 Feb 2019 20:20:58 +0100 Subject: [PATCH 088/232] v6.22 (#2574) + DietPi-Obtain_network_details | Skip loading DietPi-Globals, since we don't use them at all. Add exit path in case of concurrent execution instead. --- dietpi/func/obtain_network_details | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/dietpi/func/obtain_network_details b/dietpi/func/obtain_network_details index 6e1d940203..31d31cc586 100644 --- a/dietpi/func/obtain_network_details +++ b/dietpi/func/obtain_network_details @@ -24,11 +24,14 @@ # - IP address #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Obtain_network_details' - G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- + #. /DietPi/dietpi/func/dietpi-globals + #G_PROGRAM_NAME='DietPi-Obtain_network_details' + #G_INIT + # Import DietPi-Globals -------------------------------------------------------------- + + # Exit, if already running + pgrep 'obtain_network_details' &> /dev/null && exit #///////////////////////////////////////////////////////////////////////////////////// # Global @@ -47,7 +50,7 @@ DEV_MAX=9 Scrape_IP(){ - #ETH + # ETH for (( i=0; i<=$DEV_MAX; i++ )) do @@ -68,7 +71,7 @@ done - #WLAN + # WLAN for (( i=0; i<=$DEV_MAX; i++ )) do @@ -101,7 +104,7 @@ #///////////////////////////////////////////////////////////////////////////////////// Scrape_IP #----------------------------------------------------------------------------------- - #Output to file + # Output to file cat << _EOF_ > $FP_NETFILE $ETH_INDEX $WLAN_INDEX @@ -111,7 +114,7 @@ ETH_IP=$ETH_IP WLAN_IP=$WLAN_IP _EOF_ - #Assure that non-root user can read file: + # Assure that non-root user can read file: (( $UID )) || chmod 666 $FP_NETFILE #----------------------------------------------------------------------------------- From 8b6f46f5c48a453ae416fa23688c7e2fbed16628 Mon Sep 17 00:00:00 2001 From: WilburWalsh <47111045+WilburWalsh@users.noreply.github.com> Date: Sat, 23 Feb 2019 10:36:14 +0100 Subject: [PATCH 089/232] Gmediarender service starts with obtained IP - Gmediarender service waits for Dietpi Boot Service to finish, then uses obtained IP address - Fixed bug with missing write access for log file --- dietpi/dietpi-software | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 0a3696af95..5ac669fdd3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12342,13 +12342,15 @@ _EOF_ cat << _EOF_ > /etc/systemd/system/gmrender.service [Unit] Description=GMrender (DietPi) -After=network.target +After=network.target dietpi-boot.service [Service] Type=simple User=gmrender Group=dietpi -ExecStart=$(command -v gmediarender) -u "$(sed -n 5p /DietPi/dietpi/.hw_model)" -f "$(cat /etc/hostname)" --gstout-audiodevice=sysdefault --gstout-initial-volume-db=-1 --logfile=/var/log/gmrender.log +ExecStartPre=+/usr/bin/touch /var/log/gmrender.log +ExecStartPre=+/bin/chown gmrender /var/log/gmrender.log +ExecStart=/bin/bash -c '$(command -v gmediarender) -u "$(sed -n 5p /DietPi/dietpi/.hw_model)" -f "$(cat /etc/hostname)" --gstout-audiodevice=sysdefault --gstout-initial-volume-db=-1 --logfile=/var/log/gmrender.log -I "\$(/bin/sed -n 4p /DietPi/dietpi/.network)"' [Install] WantedBy=multi-user.target From 01c7eede64f41f19d0734fc50752d1a2eac96a98 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 15:50:53 +0100 Subject: [PATCH 090/232] v6.22 + DietPi-Software | GMediaRender: Enhance reinstall by using "usermod", if user already exists + DietPi-Software | GMediaRender: Pre-create log file; Failsafe + DietPi-Software | GMediaRender: Generally use $(command -v cmd) when adding commands to systemd units; Failsafe + DietPi-Software | GMediaRender: Generally do not use bash subshell for systemd unit Exec if not required for redirects + DietPi-Software | OpenSSH Client: Do NOT purge "openssh-client" if server is installed, since due to dependencies OpenSSH Server would be removed as well. + DietPi-Software | Minor coding and ordering --- dietpi/dietpi-software | 65 ++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 5ac669fdd3..81062fba2a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -801,7 +801,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='Roon capable audio player and core' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=7966#p7966' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7966#p7966' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 @@ -839,12 +839,12 @@ _EOF_ #------------------ software_id=163 - aSOFTWARE_WHIP_NAME[$software_id]='Gmediarender' + aSOFTWARE_WHIP_NAME[$software_id]='GMediaRender' aSOFTWARE_WHIP_DESC[$software_id]='DLNA audio render/endpoint' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=9012#p9012' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9012#p9012' #------------------ software_id=167 @@ -854,7 +854,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=9368#p9368' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9368#p9368' # Disable for ARMv8 + x86_64: aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 @@ -868,7 +868,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=12969#p12969' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12969#p12969' #------------------ software_id=86 @@ -879,7 +879,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=13160#p13160' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13160#p13160' #BitTorrent #-------------------------------------------------------------------------------- @@ -6134,8 +6134,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Allo Web Interface - software_id=159 #160 for quick reinstall + software_id=159 # Allo Web Interface (160 for quick reinstall) if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 || ${aSOFTWARE_INSTALL_STATE[160]} == 1 )); then @@ -6144,8 +6143,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Gmediarender - software_id=163 + software_id=163 # GMediaRender if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6174,8 +6172,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #AudioPhonics Pi-SPC - software_id=166 + software_id=166 # AudioPhonics Pi-SPC if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6186,8 +6183,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Raspotify - software_id=167 + software_id=167 # Raspotify if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -12331,26 +12327,32 @@ _EOF_ fi - #Gmediarender - software_id=163 + software_id=163 # GMediaRender if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rm gmrender -G dietpi,audio -s /usr/sbin/nologin + # Create/Edit user + local usercmd='useradd -rm' + getent passwd gmrender &> /dev/null && usercmd='usermod' + $usercmd gmrender -G dietpi,audio -s /usr/sbin/nologin + + # Pre-create log file + >> /var/log/gmrender.log + chown gmrender:gmrender /var/log/gmrender.log + # Create systemd unit cat << _EOF_ > /etc/systemd/system/gmrender.service [Unit] -Description=GMrender (DietPi) +Description=GMediaRender (DietPi) After=network.target dietpi-boot.service [Service] -Type=simple User=gmrender Group=dietpi -ExecStartPre=+/usr/bin/touch /var/log/gmrender.log -ExecStartPre=+/bin/chown gmrender /var/log/gmrender.log -ExecStart=/bin/bash -c '$(command -v gmediarender) -u "$(sed -n 5p /DietPi/dietpi/.hw_model)" -f "$(cat /etc/hostname)" --gstout-audiodevice=sysdefault --gstout-initial-volume-db=-1 --logfile=/var/log/gmrender.log -I "\$(/bin/sed -n 4p /DietPi/dietpi/.network)"' +ExecStartPre=!$(command -v touch) /var/log/gmrender.log +ExecStartPre=!$(command -v chown) gmrender:gmrender /var/log/gmrender.log +ExecStart=$(command -v gmediarender) -u '$(sed -n 5p /DietPi/dietpi/.hw_model)' -f '$( /dev/null G_AGP gmrender - rm /etc/systemd/system/gmrender.service + [[ -f /etc/systemd/system/gmrender.service ]] && rm /etc/systemd/system/gmrender.service - userdel -rf gmrender + getent passwd gmrender &> /dev/null && userdel -rf gmrender fi @@ -14450,11 +14451,7 @@ _EOF_ Banner_Uninstalling # This also removes OpenSSH server. So lets check OpenSSH server isn't installed before hand. - if dpkg --get-selections | grep -qi 'openssh-server'; then - - G_AGP openssh-client - - fi + dpkg-query -s 'openssh-server' &> /dev/null || G_AGP openssh-client fi From 65b34d8d8984a0298e13bd8b558333afa492444f Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 16:03:46 +0100 Subject: [PATCH 091/232] v6.22 + CHANGELOG | GMediaRender: Resolved an issue where the daemon can attach to a wrong IP and a failing service start due to missing log file + CHANGELOG | OpenSSH Client: Resolved an issue where uninstalling the OpenSSH Client will in case also remove the OpenSSH Server --- CHANGELOG.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 58fb024fe1..8b39a45464 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -14,6 +14,8 @@ Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 - RPi | Resolved an issue where I-Sabre-K2M sound card selection failed. Thanks to @klasLiesen for reporting this issue: https://github.com/Fourdee/DietPi/issues/2547 - DietPi-Software | MineOS/Koel: Resolved an issue where install on ARMv8 devices failed. Many thanks to @DeathIsUnknown for reporting this issue and solution: https://github.com/Fourdee/DietPi/issues/1880#issuecomment-464097174 +- DietPi-Software | GMediaRender: Resolved an issue where the daemon can attach to a wrong IP if multiple network devices are present. As well resolved a failing service start on fresh install if/as the log file does not exist yet. Many thanks to @WilburWalsh for reporting these issues and providing a fix: https://github.com/Fourdee/DietPi/issues/2576 +- DietPi-Software | OpenSSH Client: Resolved an issue where uninstalling the OpenSSH Client will in case also remove the OpenSSH Server. - DietPi-Software | Emby Server: We disabled the option to install it on Jessie ARM systems. This was never possible, since Debian Jessie does not provide the minimum required libc6 version. Thanks to @mbone for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5502 - DietPi-Software | Mopidy: Resolved issue with failed audio playback. Many thanks to @arkhub for reporting this issue! https://github.com/Fourdee/DietPi/issues/2536 - DietPi-Software | WireGuard: Resolved an issue with wrong client DNS entry, if on server 127.0.0.1/localhost loopback DNS entry is used. Thanks to @swrobel for reporting this issue: https://github.com/Fourdee/DietPi/issues/2482 From 221d300752dc810fdaeb5b678b1e9828f9dc319f Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 18:12:18 +0100 Subject: [PATCH 092/232] v6.22 + DietPi-Software | GMediaRender: Revert using (dash) subshell for ExecStart to allow "$(sed -n 4p /DietPi/dietpi/.network)" command substitution + DietPi-Software | GMediaRender: Use "dietpi" group for log file for consistency --- dietpi/dietpi-software | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 81062fba2a..8b4dcb4f8d 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12339,7 +12339,7 @@ _EOF_ # Pre-create log file >> /var/log/gmrender.log - chown gmrender:gmrender /var/log/gmrender.log + chown gmrender:dietpi /var/log/gmrender.log # Create systemd unit cat << _EOF_ > /etc/systemd/system/gmrender.service @@ -12351,8 +12351,8 @@ After=network.target dietpi-boot.service User=gmrender Group=dietpi ExecStartPre=!$(command -v touch) /var/log/gmrender.log -ExecStartPre=!$(command -v chown) gmrender:gmrender /var/log/gmrender.log -ExecStart=$(command -v gmediarender) -u '$(sed -n 5p /DietPi/dietpi/.hw_model)' -f '$( Date: Sat, 23 Feb 2019 19:28:54 +0100 Subject: [PATCH 093/232] v6.22 + DietPi-PostBoot | Print only file name instead of full path when executing postboot.d scripts + DietPi-PostBoot | Print login banner only if no autologin selected --- dietpi/postboot | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/dietpi/postboot b/dietpi/postboot index 152f71aff5..e225c6b84f 100644 --- a/dietpi/postboot +++ b/dietpi/postboot @@ -23,25 +23,25 @@ # Regular boot if (( $( /dev/null & fi - # - Start dietpi-services + # - Start DietPi controlled services /DietPi/dietpi/dietpi-services start fi - # Execute users custom boot scripts + # Execute optional boot scripts for f in /var/lib/dietpi/postboot.d/* do if [[ -f $f ]]; then - echo "DietPi-PostBoot | Running user script: $f" + echo "DietPi-PostBoot | Running user script: ${f##*/}" chmod +x $f $f @@ -49,10 +49,14 @@ done - # Print DietPi login banner - echo -e '\n' - /DietPi/dietpi/func/dietpi-banner 0 - echo -e ' Default Login:\n Username = root\n Password = dietpi\n\n Please login to continue\n' + # Print DietPi login banner if no autologin selected + if [[ ! -f /etc/systemd/system/getty@tty1.service.d/dietpi-autologin.conf ]]; then + + echo -e '\n' + /DietPi/dietpi/func/dietpi-banner 0 + echo -e ' Default Login:\n Username = root\n Password = dietpi\n\n Please login to continue\n' + + } #----------------------------------------------------------------------------------- exit From aef14bbc4adf64b4f5f4385b89f39fc16261b79d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 19:39:23 +0100 Subject: [PATCH 094/232] v6.22 (#2578) + DietPi-Software | UrBackup: Update install links to v2.3.7 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 50 ++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8b39a45464..bae245cb19 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,6 +9,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 +- DietPi-Software | UrBackup: Updated installed version to 2.3.7. Thanks to @DeathIsUnknown for the information: https://github.com/Fourdee/DietPi/issues/2577 Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 8b4dcb4f8d..d0464f7259 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1069,7 +1069,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=1064#p1064' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1064#p1064' #------------------ software_id=111 @@ -1078,7 +1078,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='full system backup server' aSOFTWARE_CATEGORY_INDEX[$software_id]=4 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=65#p65' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=65#p65' # No deb packages for ARMv6: aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -4125,28 +4125,27 @@ _EOF_ fi - #urbackup server - software_id=111 + software_id=111 # UrBackup Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - if (( $G_HW_ARCH == 10 )); then - - INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.2.11/urbackup-server_2.2.11_amd64.deb' + # ARMv7 + INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.3.7/urbackup-server_2.3.7_armhf.deb' - elif (( $G_HW_ARCH == 2 )); then + # x86_64 + if (( $G_HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.2.11/urbackup-server_2.2.11_armhf.deb' + INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.3.7/urbackup-server_2.3.7_amd64.deb' - #ARMv8 sourcebuild + # ARMv8 source elif (( $G_HW_ARCH == 3 )); then - INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.2.11/urbackup-server-2.2.11.tar.gz' + INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.3.7/urbackup-server-2.3.7.tar.gz' fi - #ARMv8 source build + # ARMv8 source build if (( $G_HW_ARCH == 3 )); then DEPS_LIST='build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3' @@ -4166,7 +4165,7 @@ _EOF_ cd /tmp/$G_PROGRAM_NAME rm -R urbackup-server-* - #Deb + # Deb else debconf-set-selections <<< "urbackup-server urbackup/backuppath string $G_FP_DIETPI_USERDATA/urbackup" @@ -11255,18 +11254,17 @@ _EOF_ fi - #Urbackup server - software_id=111 + software_id=111 # UrBackup Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration mkdir -p $G_FP_DIETPI_USERDATA/urbackup/urbackup_tmp_files - #As we have /tmp mounted to RAM, change tmp locations + # As we have /tmp mounted to RAM, change tmp locations sed -i '/DAEMON_TMPDIR=/c\DAEMON_TMPDIR="/var/tmp"' /etc/default/urbackupsrv - #https://github.com/Fourdee/DietPi/issues/545#issuecomment-252419739 + # https://github.com/Fourdee/DietPi/issues/545#issuecomment-252419739 #sqlite3 /usr/local/var/urbackup/backup_server_settings.db "UPDATE settings SET value = '/mnt/dietpi_userdata/urbackup/' WHERE key = 'backupfolder'" fi @@ -14468,20 +14466,20 @@ _EOF_ fi - software_id=111 + software_id=111 # UrBackup Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP urbackup-server - #+sourcebuild - rm /etc/systemd/system/urbackupsrv.service - rm /etc/default/urbackupsrv - rm /etc/logrotate.d/urbackupsrv - rm /usr/sbin/urbackupsrv - rm /usr/bin/urbackup_snapshot_helper - rm /usr/bin/urbackupsrv - rm -R /usr/share/urbackup + # +sourcebuild + [[ -f /etc/systemd/system/urbackupsrv.service ]] && rm /etc/systemd/system/urbackupsrv.service + [[ -f /etc/default/urbackupsrv ]] && rm /etc/default/urbackupsrv + [[ -f /etc/logrotate.d/urbackupsrv ]] && rm /etc/logrotate.d/urbackupsrv + [[ -f /usr/sbin/urbackupsrv ]] && rm /usr/sbin/urbackupsrv + [[ -f /usr/bin/urbackup_snapshot_helper ]] && rm /usr/bin/urbackup_snapshot_helper + [[ -f /usr/bin/urbackupsrv ]] && rm /usr/bin/urbackupsrv + [[ -d /usr/share/urbackup ]] && rm -R /usr/share/urbackup fi From 7376e4474613ccd034b1611181cf18da158fe964 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 22:07:41 +0100 Subject: [PATCH 095/232] v6.22 (#2582) + DietPi-Software | GMediaRender: Enable Buster support by using the up-to-date APT repo package --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 46 ++++++++++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index bae245cb19..d30c868013 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Emby Server: Now installs the latest version automatically (currently 4.0.1), which as well offers a native ARMv8 package: https://github.com/Fourdee/DietPi/pull/2525 - DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 +- DietPi-Software | GMediaRender: Enabled support for Debian/Raspbian Buster by using the up-to-date APT repo package. - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 - DietPi-Software | UrBackup: Updated installed version to 2.3.7. Thanks to @DeathIsUnknown for the information: https://github.com/Fourdee/DietPi/issues/2577 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d0464f7259..194ff29e74 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3591,7 +3591,7 @@ We work around this error by running APT a second time. Please do not worry and if (( $G_HW_ARCH == 3 )); then # libupnp6 for net discov with upnp/avahi - DEPS_LIST='libupnp6 libwrap0 libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file' + DEPS_LIST='libupnp6 libwrap0 libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file' Download_Install 'https://dietpi.com/downloads/binaries/all/mpd_0.20.18-1_armv8.deb' else @@ -3611,8 +3611,8 @@ We work around this error by running APT a second time. Please do not worry and #Buster+ else - # libcdio-paranoia1 and libiso9660-8 not available, but ibcdio-paranoia2 and libiso9660-11 instead - # Buster repo version >= 0.20.23, thus stay with APT for now: + # libcdio-paranoia1, libiso9660-8 and libupnp6 not available, but ibcdio-paranoia2, libiso9660-11 and libupnp13 instead + # Buster repo version >= 0.21.4, thus stay with APT for now: G_AGI mpd fi @@ -6147,27 +6147,39 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Banner_Installing - INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/gmrender_1_' - if (( $G_HW_ARCH == 10 )); then + # Stretch + Jessie: Use our updated package + if (( $G_DISTRO < 5 )); then - INSTALL_URL_ADDRESS+='amd64.deb' + INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/gmrender_1_' + if (( $G_HW_ARCH == 10 )); then - elif (( $G_HW_ARCH == 3 )); then + INSTALL_URL_ADDRESS+='amd64.deb' - INSTALL_URL_ADDRESS+='arm64.deb' + elif (( $G_HW_ARCH == 3 )); then - elif (( $G_HW_ARCH == 2 )); then + INSTALL_URL_ADDRESS+='arm64.deb' - INSTALL_URL_ADDRESS+='armv7.deb' + elif (( $G_HW_ARCH == 2 )); then - elif (( $G_HW_ARCH == 1 )); then + INSTALL_URL_ADDRESS+='armv7.deb' - INSTALL_URL_ADDRESS+='armv6.deb' + elif (( $G_HW_ARCH == 1 )); then - fi + INSTALL_URL_ADDRESS+='armv6.deb' - DEPS_LIST='libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa' - Download_Install "$INSTALL_URL_ADDRESS" + fi + + DEPS_LIST='libupnp6 gstreamer1.0-alsa gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly' + Download_Install "$INSTALL_URL_ADDRESS" + + # Buster: Use the up-to-date APT repo package + else + + G_AGI gmediarender gstreamer1.0-alsa gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly + # - Disable init.d service, use our systemd unit instead + systemctl disable gmediarender + + fi fi @@ -12912,7 +12924,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - #apt-mark auto libavformat57 libupnp6 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file &> /dev/null + #apt-mark auto libavformat57 libupnp6 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file &> /dev/null apt-mark unhold mpd 1> /dev/null G_AGP mpd libmpdclient2 getent passwd mpd &> /dev/null && userdel -rf mpd @@ -14261,7 +14273,7 @@ _EOF_ Banner_Uninstalling #apt-mark auto libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa &> /dev/null - G_AGP gmrender + G_AGP gmrender gmediarender [[ -f /etc/systemd/system/gmrender.service ]] && rm /etc/systemd/system/gmrender.service getent passwd gmrender &> /dev/null && userdel -rf gmrender From 9f7aaeef4a5b66b44a40ba8588cb9625d979c748 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 23:09:15 +0100 Subject: [PATCH 096/232] v6.22 (#2571) + DietPi-Software | WireGuard: Disable sid repo by default, only enable WireGuard packages, to prevent any accidental package upgrades + DietPi-Software | WireGuard: On RPi, install Debian repo keyring --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d30c868013..88ed4f4de6 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Emby Server: Now installs the latest version automatically (currently 4.0.1), which as well offers a native ARMv8 package: https://github.com/Fourdee/DietPi/pull/2525 - DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs, to avoid IP double use with OpenVPN. Thanks to @XRay437 for pointing this out: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-461366739 - DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/Fourdee/DietPi/issues/2491#issuecomment-462419860 +- DietPi-Software | WireGuard: Hardened "sid" repo handling on RPi, to prevent accidental non-WireGuard package installs. Thanks to @rucknapucknavitz for reporting this issue: https://github.com/Fourdee/DietPi/issues/2568#issuecomment-465725312 - DietPi-Software | GMediaRender: Enabled support for Debian/Raspbian Buster by using the up-to-date APT repo package. - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/Fourdee/DietPi/pull/2538 - DietPi-Software | UrBackup: Updated installed version to 2.3.7. Thanks to @DeathIsUnknown for the information: https://github.com/Fourdee/DietPi/issues/2577 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 194ff29e74..6711123b80 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4918,13 +4918,19 @@ _EOF_ # Odroids need to purge before we install, else, does not update to latest version... (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )) && G_AGP $kernel_packages - # Since G_AGUG does not upgrade packages with changed dependencies, in case of kernel image meta packages, those need to be installed via G_AGI. + # Since G_AGUG does not upgrade packages with changed dependencies, in case of kernel image meta packages, those need to be installed+upgraded via G_AGI. G_AGI $kernel_packages # apt-get install overrides hold state - # Add Debian "sid" repo, which contains the wireguard packages + # Add Debian "sid" repo, which contains the WireGuard packages echo 'deb https://deb.debian.org/debian/ sid main' > /etc/apt/sources.list.d/dietpi-wireguard.list - # - Set "sid" priority low enough to only install packages that are not available in main repo(s) - echo -e 'Package: *\nPin: release n=sid\nPin-Priority: 99' > /etc/apt/preferences.d/dietpi-wireguard + # - Disable sid repo via priority "-1", to prevent any accidental package upgrades: https://github.com/Fourdee/DietPi/issues/2568 + # - Enable but set sid WireGuard package priorities low enough to install only if not available in main repo(s) + echo -e 'Package: *\nPin: release n=sid\nPin-Priority: -1\n +Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Priority: 99' > /etc/apt/preferences.d/dietpi-wireguard + + # RPi: Install debian-archive-keyring, currently version 2018.1 from sid branch: https://packages.debian.org/de/sid/debian-archive-keyring + (( $G_HW_MODEL < 10 )) && Download_Install 'https://dietpi.com/downloads/binaries/rpi/debian-archive-keyring.deb' + G_AGUP # Check for existing WireGuard install From 43c7822690b7f6da3de5aad627cd35b62c1a5a26 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 23:26:22 +0100 Subject: [PATCH 097/232] v6.22 + DietPi-Patch | Inform and allow user to keep "p7zip-full" + DietPi-Patch | WireGuard: Harden "sid" repo handling and on RPi, catch up on installing the Debian keyring + DietPi-Patch | MPD: Fix permissions issue manually, prevent another reinstall for end user --- dietpi/patch_file | 52 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index f845457ed2..4b3bd8710d 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1651,22 +1651,25 @@ Also have a look at "Sonarr", another alternative TV show manager, available for G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc #------------------------------------------------------------------------------- #Mopidy fix: https://github.com/Fourdee/DietPi/issues/2536 - if grep -q '^mopidy' /etc/passwd; then - - usermod -a -G dietpi,audio -d $G_FP_DIETPI_USERDATA/mopidy mopidy - - fi + getent passwd mopidy &> /dev/null && usermod -a -G dietpi,audio -d $G_FP_DIETPI_USERDATA/mopidy mopidy #------------------------------------------------------------------------------- #Remove obsolete workaround for archive.raspberrypi.org repo on Buster: https://github.com/Fourdee/DietPi/issues/1286#issuecomment-463856159 (( $G_DISTRO == 5 && $G_HW_MODEL < 10 )) && sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/raspi.list #------------------------------------------------------------------------------- #Removed dependency on "p7zip-full", use "7zr" (p7zip) instead: https://github.com/Fourdee/DietPi/pull/2559 - dpkg-query -s p7zip-full &> /dev/null && apt-mark auto p7zip-full G_AGI p7zip - #------------------------------------------------------------------------------- - # - Reinstalls - # MPD: https://github.com/Fourdee/DietPi/issues/2462 - (( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-software reinstall 128 + if dpkg-query -s p7zip-full &> /dev/null && + ! G_WHIP_BUTTON_OK_TEXT='Yes' G_WHIP_BUTTON_CANCEL_TEXT='No' G_WHIP_YESNO '[QUESTION] Do you want to keep "p7zip-full"?\n +DietPi does not require the "p7zip-full" package anymore but just "p7zip" instead. +- "p7zip" provides the lightweight standalone "7zr" command to handle 7zip archives only. +- "p7zip-full" additionally provides the "7z" and "7za" commands which can handle other archive types as well. + However, DietPi internally uses "unzip", "tar" and "unrar" to handle those.\n +Do you still want to keep "p7zip-full"?'; then + + apt-mark auto p7zip-full + G_AGA + + fi #------------------------------------------------------------------------------- #Fix Pi-hole permissions to allow "pihole -up" if [[ -d /var/www/html/pihole ]]; then @@ -1676,6 +1679,35 @@ Also have a look at "Sonarr", another alternative TV show manager, available for fi #------------------------------------------------------------------------------- + #WireGuard: Harden "sid" repo handling and on RPi, catch up on installing the Debian keyring: https://github.com/Fourdee/DietPi/pull/2571 + if [[ -f /etc/apt/preferences.d/dietpi-wireguard ]]; then + + if (( $G_HW_MODEL < 10 )); then + + wget https://dietpi.com/downloads/binaries/rpi/debian-archive-keyring.deb + dpkg -i debian-archive-keyring.deb + rm debian-archive-keyring.deb + + fi + + echo -e 'Package: *\nPin: release n=sid\nPin-Priority: -1\n +Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Priority: 99' > /etc/apt/preferences.d/dietpi-wireguard + + fi + #------------------------------------------------------------------------------- + #MPD: Fix permissions issue: https://github.com/Fourdee/DietPi/issues/2462 + if [[ -f /etc/mpd/mpd.conf ]]; then + + sed -Ei '/^(user|group)[[:blank:]]/d' /etc/mpd/mpd.conf + sed -i '/^Group=/d' /lib/systemd/system/mpd.service + G_CONFIG_INJECT 'User=' 'User=mpd' /lib/systemd/system/mpd.service '\[Service\]' + G_CONFIG_INJECT 'PermissionsStartOnly=' 'PermissionsStartOnly=true' /lib/systemd/system/mpd.service '^User=mpd' + usermod -a -G audio,dietpi mpd + systemctl daemon-reload + systemctl restart mpd + + fi + #------------------------------------------------------------------------------- fi From 6fd3d47ffe4890fa12710b1a6047d3b525b24158 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 23:43:44 +0100 Subject: [PATCH 098/232] v6.22 + DietPi-PostBoot | Syntax --- dietpi/postboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/postboot b/dietpi/postboot index e225c6b84f..43c2e96f47 100644 --- a/dietpi/postboot +++ b/dietpi/postboot @@ -56,7 +56,7 @@ /DietPi/dietpi/func/dietpi-banner 0 echo -e ' Default Login:\n Username = root\n Password = dietpi\n\n Please login to continue\n' - } + fi #----------------------------------------------------------------------------------- exit From 0f3d701adc187ca02c902330bc302adc6c017c9b Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Feb 2019 23:54:06 +0100 Subject: [PATCH 099/232] v6.22 (#2572) + DietPi-Globals | G_AG*: Remove --allow-downgrades/remove-essential/unauthenticated, since these cases are mostly harmful + DietPi-Globals | G_AG*: Use "G_DIETPI-NOTIFY 2 '\e[0m" for initial info print to still force white text in contrast to apt-get output + DietPi-Globals | G_AG*: Do not create input string array, since "for i in $string" has exactly the same result + DietPi-Globals | G_AG*: "-qq" includes "-y" + DietPi-Globals | G_AG*: Reorder apt-get command and options to have consistent "apt-get [] []" + DietPi-Globals | G_AG*: No colour reset required after apt-get output, since G_ERROR_HANDLER implies this + DietPi-Globals | G_AG*: Add "-q(q)" to certain commands to reduce processing output a bid --- dietpi/func/dietpi-globals | 103 ++++++++++++------------------------- 1 file changed, 32 insertions(+), 71 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 0e1e093021..64757b22e6 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -156,7 +156,7 @@ Please check if one of the following applies: - You started this script from within another DietPi program, causing a loop.\n Please assure that the concurrent execution has finished, before retrying, otherwise cancel this instance.\n The following info might help: -$(ps f -eo pid,user,tty,cmd | grep -i [d]ietpi)"; then +$(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then G_DIETPI-NOTIFY 1 "Canceled $G_PROGRAM_NAME due to concurrent execution" exit 1 @@ -1545,32 +1545,22 @@ $print_logfile_info G_CHECK_ROOT_USER 1 local string=$@ - local force_options='' - - if (( $G_DISTRO >= 4 )); then - - force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' - - else - - force_options='--force-yes' - - fi + local options='' + (( $G_DISTRO >= 4 )) && options='--allow-change-held-packages' G_ERROR_HANDLER_RETRY=1 while (( $G_ERROR_HANDLER_RETRY )) do - G_ERROR_HANDLER_COMMAND="G_AGI: $string" + G_ERROR_HANDLER_COMMAND="G_AGI $string" G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT #-qq can add a slight period of appearing nothing is happening, lets inform user - G_DIETPI-NOTIFY 0 "APT installation for: \e[33m$string\e[0m, please wait..." + G_DIETPI-NOTIFY 2 "\e[0mAPT installation for: \e[33m$string\e[0m, please wait..." echo -ne '\e[90m' - DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $force_options $string 2>&1 | tee $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -qq $options install $string 2>&1 | tee $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' G_ERROR_HANDLER @@ -1586,19 +1576,15 @@ $print_logfile_info G_CHECK_ROOT_USER 1 - local string=( "$@" ) + local string=$@ local options='' - if (( $G_DISTRO >= 4 )); then - - options+=' --allow-change-held-packages' - - fi + (( $G_DISTRO >= 4 )) && options='--allow-change-held-packages' G_ERROR_HANDLER_RETRY=1 while (( $G_ERROR_HANDLER_RETRY )) do - G_ERROR_HANDLER_COMMAND="G_AGP: ${string[@]}" + G_ERROR_HANDLER_COMMAND="G_AGP $string" G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT # - Remove non-matching packages from string, which are not installed, to prevent failures. @@ -1610,10 +1596,10 @@ $print_logfile_info local packages_to_remove='' dpkg --get-selections > $fp_temp local i=0 - for i in "${string[@]}"; do + for i in $string; do if grep -qi "^$i[[:space:]|:]" $fp_temp || - { echo -e $i | grep -qi '*' && grep -qi "^$i" $fp_temp; }; then #wildcard check + { grep -qi '*' <<< $i && grep -qi "^$i" $fp_temp; }; then #wildcard check packages_to_remove+="$i " G_DIETPI-NOTIFY 2 "Install verified: $i" @@ -1625,17 +1611,15 @@ $print_logfile_info fi done - rm $fp_temp unset string #habbit :) if [[ $packages_to_remove ]]; then - G_DIETPI-NOTIFY 0 "APT removal for: \e[33m$packages_to_remove\e[0m, please wait..." + G_DIETPI-NOTIFY 2 "\e[0mAPT removal for: \e[33m$packages_to_remove\e[0m, please wait..." echo -ne '\e[90m' - DEBIAN_FRONTEND=noninteractive apt-get purge -y $packages_to_remove $options 2>&1 | tee $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -qq $options purge $packages_to_remove 2>&1 | tee $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' else @@ -1664,12 +1648,11 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND='G_AGA' G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT - G_DIETPI-NOTIFY 0 'APT autoremove + purge, please wait...' + G_DIETPI-NOTIFY 2 '\e[0mAPT autoremove + purge, please wait...' echo -ne '\e[90m' - DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y 2>&1 | tee $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -qq --purge autoremove 2>&1 | tee $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' G_ERROR_HANDLER @@ -1692,12 +1675,11 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND='G_AGF' G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT - G_DIETPI-NOTIFY 0 'APT fix, please wait...' + G_DIETPI-NOTIFY 2 '\e[0mAPT fix, please wait...' echo -ne '\e[90m' - DEBIAN_FRONTEND=noninteractive apt-get install -f -y 2>&1 | tee $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -qq -f install 2>&1 | tee $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' G_ERROR_HANDLER @@ -1720,13 +1702,12 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND='G_AGUP' G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT - G_DIETPI-NOTIFY 0 'APT update, please wait...' + G_DIETPI-NOTIFY 2 '\e[0mAPT update, please wait...' echo -ne '\e[90m' DEBIAN_FRONTEND=noninteractive apt-get clean 2>&1 | tee $G_FP_LOG_APT - DEBIAN_FRONTEND=noninteractive apt-get update 2>&1 | tee -a $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -q update 2>&1 | tee -a $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' G_ERROR_HANDLER @@ -1749,19 +1730,11 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND='G_AGUG' G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT - G_DIETPI-NOTIFY 0 'APT upgrade, please wait...' - - local options='' - if (( $G_DISTRO >= 4 )); then - - options='--allow-unauthenticated' - - fi + G_DIETPI-NOTIFY 2 '\e[0mAPT upgrade, please wait...' echo -ne '\e[90m' - DEBIAN_FRONTEND=noninteractive apt-get upgrade -y $options 2>&1 | tee $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -qq upgrade 2>&1 | tee $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' G_ERROR_HANDLER @@ -1777,6 +1750,9 @@ $print_logfile_info G_CHECK_ROOT_USER 1 + local options='' + (( $G_DISTRO >= 4 )) && options='--allow-change-held-packages' + G_ERROR_HANDLER_RETRY=1 while (( $G_ERROR_HANDLER_RETRY )) do @@ -1784,22 +1760,11 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND='G_AGDUG' G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT - if (( $G_DISTRO >= 4 )); then - - force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' - - else - - force_options='--force-yes' - - fi - - G_DIETPI-NOTIFY 0 'APT dist-upgrade, please wait...' + G_DIETPI-NOTIFY 2 '\e[0mAPT dist-upgrade, please wait...' echo -ne '\e[90m' - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y $force_options 2>&1 | tee $G_FP_LOG_APT + DEBIAN_FRONTEND=noninteractive apt-get -qq $options dist-upgrade 2>&1 | tee $G_FP_LOG_APT G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - echo -e '\e[0m' G_ERROR_HANDLER @@ -1818,40 +1783,36 @@ $print_logfile_info local fp_temp='/tmp/.G_AG_CHECK_INSTALL_PREREQ' local exit_code=0 - local string=( "$@" ) + local string=$@ local packages_to_install='' - G_DIETPI-NOTIFY 0 "Checking for pre-req APT packages: \e[33m${string[*]}" + G_DIETPI-NOTIFY 2 "Checking for pre-req APT packages: \e[33m$string" dpkg --get-selections > $fp_temp local i=0 - for i in "${string[@]}"; do + for i in $string; do if ! grep -qi "^$i[[:space:]]" $fp_temp; then - G_DIETPI-NOTIFY 2 "Flagged for installation: $i" + G_DIETPI-NOTIFY 2 "Flagged for installation: \e[33m$i" packages_to_install+=" $i" fi done + rm $fp_temp if [[ $packages_to_install ]]; then - G_DIETPI-NOTIFY -2 'Installing pre-req APT packages' G_AGI $packages_to_install exit_code=$? else - G_DIETPI-NOTIFY 2 'Pre-req APT packages are installed' + G_DIETPI-NOTIFY 2 'Pre-req APT packages were already installed' fi - #G_AGI now handles the error - - rm $fp_temp - return $exit_code } From 2cd6ac139156aade8e041b4c5f84e3da23a1f2dd Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 24 Feb 2019 16:19:10 +0100 Subject: [PATCH 100/232] v6.22 + DietPi-Globals | Fix G_* function execution via G_SUDO() by explicitly sourcing DietPi-Globals; Workaround required since "sudo -s" does not wait for all bashrc scripts being loaded before executing the provided command + DietPi-Globals | Minor coding --- dietpi/func/dietpi-globals | 51 ++++++++++++++------------------------ 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 64757b22e6..e52a16e6c7 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -127,10 +127,11 @@ _EOF_ #INIT functions for originating script # - Stuff we can't init in main globals/funcs due to /etc/bashrc.d/ load into current session. - G_INIT_ALLOW_CONCURRENT=${G_INIT_ALLOW_CONCURRENT:-0} - G_INIT_WAIT_CONCURRENT=${G_INIT_WAIT_CONCURRENT:-5} G_INIT(){ + G_INIT_ALLOW_CONCURRENT=${G_INIT_ALLOW_CONCURRENT:-0} + G_INIT_WAIT_CONCURRENT=${G_INIT_WAIT_CONCURRENT:-5} + # Check for concurrent execution if (( ! $G_INIT_ALLOW_CONCURRENT )); then @@ -149,7 +150,7 @@ _EOF_ else G_WHIP_BUTTON_OK_TEXT='Retry' - if ! G_WHIP_YESNO "WARNING: Concurrent execution of $G_PROGRAM_NAME detected.\n + if ! G_WHIP_YESNO "WARNING: Concurrent execution of $G_PROGRAM_NAME detected\n Please check if one of the following applies: - This script already runs on another terminal/SSH session. - Currently a cron or systemd background job executes the script. @@ -457,7 +458,6 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - G_CHECK_ROOT_USER_VERIFIED=${G_CHECK_ROOT_USER_VERIFIED:-0} #only check once for each session # $1 = mode # - 0 = Exit all linked scripts (kill all) # - 1 = Kill current script only, excluding the shell. @@ -468,9 +468,9 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then if (( $UID )); then local input=0 - disable_error=1 G_CHECK_VALIDINT $1 && input=$1 + disable_error=1 G_CHECK_VALIDINT "$1" && input=$1 - G_DIETPI-NOTIFY 1 'Root privileges required. Please run the command with "G_SUDO", or, "sudo -i".' + G_DIETPI-NOTIFY 1 'Root privileges required. Please run the command with "G_SUDO", or, "sudo -s".' if (( $input == 0 )); then @@ -493,7 +493,6 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then } - G_CHECK_ROOTFS_RW_VERIFIED=${G_CHECK_ROOTFS_RW_VERIFIED:-0} #only check once for each session G_CHECK_ROOTFS_RW(){ if [[ $G_CHECK_ROOTFS_RW_VERIFIED != 1 ]]; then @@ -519,12 +518,8 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then # Alias defines #----------------------------------------------------------------------------------- #DietPi scripts, moved from /etc/bash.bashrc - # - Sudo command, that ensures profile.d is reloaded (ensures ENV with our globals) - G_SUDO(){ - - sudo -i $@ - - } + # - Sudo command, that ensures DietPi-Globals with G_* commands are loaded + G_SUDO(){ sudo -s . /DietPi/dietpi/func/dietpi-globals && $@; } # - DietPi programs alias sudo='sudo ' # https://github.com/Fourdee/DietPi/issues/424 @@ -621,11 +616,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then #Update backtitle WHIP_BACKTITLE="$G_PROGRAM_NAME | $G_HW_MODEL_DESCRIPTION" - if [[ -r '/DietPi/dietpi/.network' ]]; then - - WHIP_BACKTITLE+=" | IP: $(sed -n 4p /DietPi/dietpi/.network)" - - fi + [[ -r '/DietPi/dietpi/.network' ]] && WHIP_BACKTITLE+=" | IP: $(sed -n 4p /DietPi/dietpi/.network)" #Automaticaly set size of whiptail box and contents local input_mode=$1 @@ -833,7 +824,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then # - Display a whip message G_WHIP_MSG(){ - WHIP_MESSAGE=("$@") + WHIP_MESSAGE=$@ if (( $G_USER_INPUTS )); then @@ -854,7 +845,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then # - Display a whip message inside a scrollbox G_WHIP_SCROLLBOX(){ - WHIP_MESSAGE=("$@") + WHIP_MESSAGE=$@ if (( $G_USER_INPUTS )); then @@ -880,7 +871,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then if (( $G_USER_INPUTS )); then - WHIP_MESSAGE=("$@") + WHIP_MESSAGE=$@ G_WHIP_INIT 0 local option_default_no='--defaultno' [[ ${G_WHIP_DEFAULT_ITEM,,} == 'yes' || ${G_WHIP_DEFAULT_ITEM,,} == 'ok' ]] && option_default_no='' @@ -904,7 +895,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then if (( $G_USER_INPUTS )); then - WHIP_MESSAGE=("$@") + WHIP_MESSAGE=$@ G_WHIP_INIT 0 G_WHIP_RETURNED_VALUE=$(whiptail --title "$G_PROGRAM_NAME" --inputbox "$WHIP_MESSAGE" --ok-button "$G_WHIP_BUTTON_OK_TEXT" --cancel-button "$G_WHIP_BUTTON_CANCEL_TEXT" --default-item "$G_WHIP_DEFAULT_ITEM" --backtitle "$WHIP_BACKTITLE" $WHIP_SIZE_Y $WHIP_SIZE_X "$G_WHIP_DEFAULT_ITEM" 3>&1 1>&2 2>&3; echo $? > /tmp/.G_WHIP_INPUTBOX_RESULT) result=$(&1 1>&2 2>&3; echo $? > /tmp/.WHIP_MENU_RESULT) result=$(&1 1>&2 2>&3; echo $? > /tmp/.WHIP_CHECKLIST_RESULT) G_WHIP_RETURNED_VALUE=$(echo -e "$G_WHIP_RETURNED_VALUE" | tr '\n' ' ') @@ -1368,7 +1359,7 @@ $print_logfile_info G_ERROR_HANDLER - rm /tmp/G_ERROR_HANDLER_COMMAND &> /dev/null + [[ -f /tmp/G_ERROR_HANDLER_COMMAND ]] && rm /tmp/G_ERROR_HANDLER_COMMAND done @@ -2133,11 +2124,7 @@ $print_logfile_info #Not yet compatible with dietpi global commands. single bash commands only with no error handling. G_THREADING_ENABLED=${G_THREADING_ENABLED:-1} G_THREAD_COUNT=${G_THREAD_COUNT:--1} - if [[ -z $G_THREAD_COMMAND ]]; then - - G_THREAD_COMMAND=() - - fi + [[ $G_THREAD_COMMAND ]] || G_THREAD_COMMAND=() G_THREAD_START(){ @@ -2172,7 +2159,7 @@ $print_logfile_info # fi - while true + while : do local thread_active=0 From cbfc4e6363d0a11d73c250740b6afcd992cd0e4a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 24 Feb 2019 22:13:34 +0100 Subject: [PATCH 101/232] v6.22 (#2586) + DietPi-Config | Fix wrong shown connection state where in some cases a route is shown but suffixed with "linkdown" + DietPi-Obtain_network_details | Rewrite: Scan more targeted via /sys/class/net entries: Performance! + DietPi-Obtain_network_details | Verify that device with assigned IP is actually connected, via "ip a" =~ "UP" flag --- CHANGELOG.txt | 1 + dietpi/dietpi-config | 4 +- dietpi/func/obtain_network_details | 118 +++++++++++++++-------------- 3 files changed, 65 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 88ed4f4de6..b706208c22 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -15,6 +15,7 @@ Changes / Improvements / Optimisations: Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/Fourdee/DietPi/issues/2529 +- General | Resolved an issue where DietPi-Config and banner shows wrong adapter state if it is not connected but has an IP assigned. Thanks to @msongz for reporting this issue: https://github.com/Fourdee/DietPi/issues/2573 - RPi | Resolved an issue where I-Sabre-K2M sound card selection failed. Thanks to @klasLiesen for reporting this issue: https://github.com/Fourdee/DietPi/issues/2547 - DietPi-Software | MineOS/Koel: Resolved an issue where install on ARMv8 devices failed. Many thanks to @DeathIsUnknown for reporting this issue and solution: https://github.com/Fourdee/DietPi/issues/1880#issuecomment-464097174 - DietPi-Software | GMediaRender: Resolved an issue where the daemon can attach to a wrong IP if multiple network devices are present. As well resolved a failing service start on fresh install if/as the log file does not exist yet. Many thanks to @WilburWalsh for reporting these issues and providing a fix: https://github.com/Fourdee/DietPi/issues/2576 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index fd6d7fd985..3cd2537510 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2765,7 +2765,7 @@ _EOF_ ETH_MODE_TARGET=$ETH_MODE #Connected and Valid IP? - ETH_CONNECTED=$(ip r | grep -ci -m1 "eth$ETH_DEV_INDEX") + ETH_CONNECTED=$(ip -o r l dev eth$ETH_DEV_INDEX | grep -vcim1 '[[:blank:]]linkdown') #Enabled and Connected if (( $ETH_DISABLED == 0 && $ETH_CONNECTED == 1 )); then @@ -2789,7 +2789,7 @@ _EOF_ WIFI_MODE_TARGET=$WIFI_MODE #Connected and Valid IP? - WIFI_CONNECTED=$(ip r | grep -ci -m1 "wlan$WIFI_DEV_INDEX") + WIFI_CONNECTED=$(ip -o r l dev wlan$ETH_DEV_INDEX | grep -vcim1 '[[:blank:]]linkdown') #Enabled and Connected if (( $WIFI_DISABLED == 0 && $WIFI_CONNECTED == 1 )); then diff --git a/dietpi/func/obtain_network_details b/dietpi/func/obtain_network_details index 31d31cc586..27dcce9f4c 100644 --- a/dietpi/func/obtain_network_details +++ b/dietpi/func/obtain_network_details @@ -10,26 +10,19 @@ #//////////////////////////////////// # # Info: + # - Location: /{DietPi,boot}/dietpi/func/obtain_network_details # - Attempts to find the 1st available index numbers for eth[0-9] and wlan[0-9] devices # - Obtains the active network adapter (eth, then wlan). - # - Saves the above data to $FP_NETFILE for use systemwide + # - Saves the above data to $FP_NETFILE for use system-wide # - # $FP_NETFILE line1 - # - eth index - # $FP_NETFILE line2 - # - wlan index - # $FP_NETFILE line3 - # - Active adapter name (eg: eth0) - # $FP_NETFILE line4 - # - IP address + # line1: eth index + # line2: wlan index + # line3: Active adapter name (eg: eth0) + # line4: Active IP address + # line5: ETH_IP= + # line6: WLAN_IP= #//////////////////////////////////// - # Import DietPi-Globals -------------------------------------------------------------- - #. /DietPi/dietpi/func/dietpi-globals - #G_PROGRAM_NAME='DietPi-Obtain_network_details' - #G_INIT - # Import DietPi-Globals -------------------------------------------------------------- - # Exit, if already running pgrep 'obtain_network_details' &> /dev/null && exit @@ -39,61 +32,74 @@ FP_NETFILE='/DietPi/dietpi/.network' - ETH_INDEX=0 - WLAN_INDEX=0 - - ACTIVE_DEVICE='NONE' + ETH_INDEX='' + WLAN_INDEX='' + ACTIVE_DEVICE='' + ACTIVE_IP='' ETH_IP='' WLAN_IP='' - IP_ADDRESS='Use dietpi-config to setup a connection' - DEV_MAX=9 - Scrape_IP(){ + Scan(){ # ETH - for (( i=0; i<=$DEV_MAX; i++ )) + local eth_dev='' eth_index='' eth_out='' eth_ip='' + for i in /sys/class/net/eth* do - if ETH_IP=$(ip -o a s eth$i 2>/dev/null); then + # Check if any eth dev exists + [[ -e $i ]] || break - ETH_INDEX=$i - ETH_IP=${ETH_IP#*inet* } - ETH_IP=${ETH_IP%%/*} - if [[ $ETH_IP ]]; then + # Get dev name and index, assign not yet if lower index found + eth_dev=${i#*net/} + eth_index=${eth_dev#eth} + [[ $ETH_INDEX ]] || ETH_INDEX=$eth_index - ACTIVE_DEVICE="eth$ETH_INDEX" - IP_ADDRESS=$ETH_IP - break + # Get and check IP, assign not yet if lower index IP found + eth_out=$(ip a s $eth_dev 2>/dev/null) || continue + eth_ip=${eth_out#*inet* } + eth_ip=${eth_ip%%/*} + [[ $eth_ip ]] || continue + [[ $ETH_IP ]] || { ETH_IP=$eth_ip; ETH_INDEX=$eth_index; } - fi + # Check connection state + [[ $eth_out =~ [[:blank:]]UP[[:blank:]] ]] || continue - fi + # Assign active dev info + ETH_INDEX=$eth_index + ETH_IP=$eth_ip + ACTIVE_DEVICE=$eth_dev + ACTIVE_IP=$ETH_IP + break done # WLAN - for (( i=0; i<=$DEV_MAX; i++ )) + local wlan_dev='' wlan_index='' wlan_out='' wlan_ip='' + for i in /sys/class/net/wlan* do - if WLAN_IP=$(ip -o a s wlan$i 2>/dev/null); then - - WLAN_INDEX=$i - WLAN_IP=${WLAN_IP#*inet* } - WLAN_IP=${WLAN_IP%%/*} - if [[ $WLAN_IP ]]; then - - if [[ ! $ETH_IP ]]; then - - ACTIVE_DEVICE="wlan$WLAN_INDEX" - IP_ADDRESS=$WLAN_IP + [[ -e $i ]] || break - fi + # Get dev name and index, assign not yet if lower index found + wlan_dev=${i#*net/} + wlan_index=${wlan_dev#wlan} + [[ $WLAN_INDEX ]] || WLAN_INDEX=$wlan_index - break + # Get and check IP, assign not yet if lower index IP found + wlan_out=$(ip a s $wlan_dev 2>/dev/null) || continue + wlan_ip=${wlan_out#*inet* } + wlan_ip=${wlan_ip%%/*} + [[ $wlan_ip ]] || continue + [[ $WLAN_IP ]] || { WLAN_IP=$wlan_ip; WLAN_INDEX=$wlan_index; } - fi + # Check connection state + [[ $wlan_out =~ [[:blank:]]UP[[:blank:]] ]] || continue - fi + # Assign active dev info if none (eth) assigned yet + WLAN_INDEX=$wlan_index + WLAN_IP=$wlan_ip + [[ $ACTIVE_DEVICE ]] || { ACTIVE_DEVICE=$wlan_dev; ACTIVE_IP=$WLAN_IP; } + break done @@ -102,19 +108,19 @@ #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - Scrape_IP + Scan #----------------------------------------------------------------------------------- - # Output to file + # Write to file cat << _EOF_ > $FP_NETFILE -$ETH_INDEX -$WLAN_INDEX -$ACTIVE_DEVICE -$IP_ADDRESS +${ETH_INDEX:-0} +${WLAN_INDEX:-0} +${ACTIVE_DEVICE:-NONE} +${ACTIVE_IP:-Use dietpi-config to setup a connection} ETH_IP=$ETH_IP WLAN_IP=$WLAN_IP _EOF_ - # Assure that non-root user can read file: + # Assure that non-root user can write file (( $UID )) || chmod 666 $FP_NETFILE #----------------------------------------------------------------------------------- From c323c6baaf8c9903b6d1f07a4fd8ce7e13c428b1 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 25 Feb 2019 02:13:30 +0100 Subject: [PATCH 102/232] META | DietPi-Survey_report: Write to /tmp first, move to /var/www/survey afterwards --- .meta/dietpi-survey_report | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 6cf4d6542b..c748719f1e 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -4,7 +4,7 @@ # Created by Micha / micha@dietpi.com / dietpi.com #----------------------------------------------------------- - #Globals - benchmarks + # Globals - benchmarks #----------------------------------------------------------- # NB: PLEASE ENSURE HW_MODEL INDEX ENTRIES MATCH : PREP, dietpi-obtain_hw_model, dietpi-survey_results, # NBB: DO NOT REORDER INDEX's. These are now fixed and will never change (due to survey results etc) @@ -71,7 +71,6 @@ # - Optional benchmarks declare -A aBENCH_CUSTOMFS_WRITE declare -A aBENCH_CUSTOMFS_READ - declare -A aBENCH_NET_LAN_SPEED #Results @@ -117,7 +116,7 @@ aBENCH_RESULT_NET_LAN_SPEED_AVG=() #----------------------------------------------------------- - #Globals - Survey + # Globals - Survey #----------------------------------------------------------- SURVEY_COUNT_TOTAL=0 SURVEY_COUNT_EMPTY=0 @@ -520,7 +519,6 @@ #Done, clear vars unset BENCH_VERSION unset BENCH_HW_MODEL - unset BENCH_CPU unset BENCH_ROOTFS_WRITE unset BENCH_ROOTFS_READ @@ -528,7 +526,6 @@ unset BENCH_RAM_READ unset BENCH_CPU_TEMP_START unset BENCH_CPU_TEMP_END - unset BENCH_CUSTOMFS_WRITE unset BENCH_CUSTOMFS_READ unset BENCH_NET_LAN_SPEED @@ -606,6 +603,12 @@ done + # Navigate to parent /tmp + cd /tmp + + # Clean up reports dir + rm -R /tmp/dietpi-survey_report + SURVEY_SENTCOUNT_TOTAL=0 for i in ${!aSURVEY_SENTCOUNT[@]} do @@ -852,15 +855,16 @@ done # - Optional benchmarks CUSTOMFS - # aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]=$default_min_value - # aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]=0 - # aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]=0 + #aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]=$default_min_value + #aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]=0 + #aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]=0 - # aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=$default_min_value - # aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]=0 - # aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]=0 + #aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=$default_min_value + #aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]=0 + #aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]=0 - cat << _EOF_ > /var/www/survey/index.html + # Create HTML file + cat << _EOF_ > index.html -

DietPi-Survey report page:

- Uploads since: 01.01.2019 00:00:00 UTC
+

DietPi-Survey report page

+ Uploads since: 01.01.2019 00:00:00 UTC
Last update: $(TZ=UTC date "+%Y-%m-%d %T UTC")

- - - -
Total user count$SURVEY_COUNT_TOTAL
Users opted in$(( $SURVEY_COUNT_TOTAL - $SURVEY_COUNT_EMPTY ))
Users opted out$SURVEY_COUNT_EMPTY
- -

DietPi-Survey versions:

- - $(for i in ${!aSURVEY_VERSION[@]}; do echo ""; done | sort -nrk 1.24 -t ' ') -
DietPi-Survey v$i ${aSURVEY_VERSION[$i]}
- -

DietPi-Survey opt-in upload counts:

- - - - $(for i in ${!aSURVEY_SENTCOUNT[@]}; do echo ""; done | sort -nrk 1.9 -t ' ') + + +
Overall upload count$SURVEY_SENTCOUNT_TOTAL
Upload countby user count
$i ${aSURVEY_SENTCOUNT[$i]}
Total install count$SURVEY_COUNT_TOTAL
Opted in installs$(( $SURVEY_COUNT_TOTAL - $SURVEY_COUNT_EMPTY ))
Opted out installs$SURVEY_COUNT_EMPTY

DietPi versions:

diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index f5d4b3c252..d6bafceb69 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -23,23 +23,20 @@ # $(sed -n 5p /DietPi/dietpi/.hw_model).txt #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Survey' G_CHECK_ROOT_USER G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- EXIT_CODE=1 # 1=failed to send survey, 0=survey sent, 2=opted out and sent - #Grab Input (valid interger) - INPUT=0 - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 + # Grab Input (valid interger) + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 - #Force opted in, for automated installations by default - OPTED_IN=1 #1=yes | 0=no and purge data - SURVEY_SENTCOUNT=0 - SURVEY_VERSION=6 + # Force opted in for automated installations by default + OPTED_IN=1 # 1=yes | 0=no and purge data DIETPI_VERSION="$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB" UNIQUE_ID=$(sed -n 5p /DietPi/dietpi/.hw_model) @@ -50,21 +47,12 @@ SFTP_PASS='upload2dietpi' FP_SETTINGS='/DietPi/dietpi/.dietpi-survey' - Write_Settings(){ - - cat << _EOF_ > $FP_SETTINGS -$OPTED_IN -$SURVEY_SENTCOUNT -_EOF_ - - } - + Write_Settings(){ echo $OPTED_IN > $FP_SETTINGS; } Read_Settings(){ - OPTED_IN=$(sed -n 1p $FP_SETTINGS) - # Force interactive mode, if invalid opt value is found: - (( OPTED_IN < 0 || OPTED_IN > 1 )) && INPUT=0 - SURVEY_SENTCOUNT=$(sed -n 2p $FP_SETTINGS) + OPTED_IN=$(<$FP_SETTINGS) + # Force interactive mode if invalid opt value is found + [[ $OPTED_IN == [01] ]] || INPUT=0 } @@ -84,10 +72,8 @@ _EOF_ cat << _EOF_ > $UPLOAD_FILENAME #!/bin/bash # ------------------------- -((aSURVEY_VERSION[$SURVEY_VERSION]++)) -# ------------------------- -((aSURVEY_SENTCOUNT[$((SURVEY_SENTCOUNT+1))]++)) ((aDIETPI_VERSION[$DIETPI_VERSION]++)) +# ------------------------- ((aGIT_BRANCH[$gitbranch]++)) ((aDEVICE_NAME[$G_HW_MODEL_DESCRIPTION]++)) ((aCPU_ARCH[$G_HW_ARCH_DESCRIPTION]++)) @@ -137,7 +123,7 @@ _EOF_ local info_failure_msg='Failed to connect to SFTP server. Please try again later. If problems persist, please report this issue to the DietPi dev team (forum or GitHub repo).' - #Check if we have a working internet connection beforehand + # Check if we have a working internet connection beforehand G_USER_INPUTS=0 G_ERROR_HANDLER_INFO_ONLY=1 G_CHECK_URL "$SFTP_ADDR" if (( $G_ERROR_HANDLER_EXITCODE_RETURN == 0 )); then @@ -152,7 +138,7 @@ _EOF_ fi - #Upload to server + # Upload to server curl --connect-timeout 8 --retry 1 --retry-delay 4 -sT "$UPLOAD_FILENAME" sftp://"$SFTP_USER":"$SFTP_PASS"@"$SFTP_ADDR"/survey/ if (( $? )); then @@ -164,8 +150,6 @@ _EOF_ EXIT_CODE=0 G_DIETPI-NOTIFY 0 'Successfully sent survey data' - # Increase sent count - ((SURVEY_SENTCOUNT++)) # Successful upload + opted out + interactive elif (( ! $INPUT )); then @@ -190,19 +174,19 @@ _EOF_ # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - #Read data from .dietpi-survey file + # Read data from .dietpi-survey file if [[ -f $FP_SETTINGS ]]; then Read_Settings - #Force interactive user choice, if no settings file found = no choice made yet + # Force interactive user choice, if no settings file found = no choice made yet elif (( $G_USER_INPUTS )); then INPUT=0 fi - #Input mode: Send survey if opted in or empty file if opted out + # Input mode: Send survey if opted in or empty file if opted out if (( $INPUT == 1 )); then Generate_File @@ -221,7 +205,7 @@ _EOF_ ) - G_WHIP_MENU "DietPi-Survey would like to collect anonymous statistics about your hardware, DietPi software and settings. \ + if G_WHIP_MENU "DietPi-Survey would like to collect anonymous statistics about your hardware, DietPi software and settings. \ This allows us to focus development based on popularity. NO private data will be collected and NO ONE can identify you based on the data. \ The data is sent via secured connection to our SFTP server and is stored there unreadable to the public upload user. \ If you agree, your uploaded data will be automatically updated on every DietPi-Update and DietPi-Software usage. \ @@ -230,8 +214,7 @@ The current survey statistics can be reviewed at: https://dietpi.com/survey Your personal upload file would look like this: $(<$UPLOAD_FILENAME) -Would you like to join DietPi-Survey?" - if (( ! $? )); then +Would you like to join DietPi-Survey?"; then OPTED_IN=$G_WHIP_RETURNED_VALUE Send_File diff --git a/dietpi/patch_file b/dietpi/patch_file index 5956861a03..0e9e8dbe5e 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1666,6 +1666,14 @@ _EOF_ fi + fi + #------------------------------------------------------------------------------- + #DietPi-Survey: Remove survey sent count from settings file: https://github.com/MichaIng/DietPi/pull/2626 + if [[ -f /DietPi/dietpi/.dietpi-survey ]]; then + + local survey_opted_in=$(sed -n 1p /DietPi/dietpi/.dietpi-survey) + echo $survey_opted_in > /DietPi/dietpi/.dietpi-survey + fi #------------------------------------------------------------------------------- #Reinstalls From 634851d6da7eefb8e5f0dfbeb673ac971a959fcf Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 10 Mar 2019 16:59:12 +0100 Subject: [PATCH 173/232] v6.22 + DietPi-Software | DietPi-RAMlog: Fix wrong logging mode estimation at end of uninstall when disabling/uninstalling and enabling/installing RAMlog again: Uninstall adds "#/var/log" to fstab, install only removes "[[:blank:]]/var/log[[:blank:]]", so when uninstall finalise is reached again, it will find "#/var/log" and detects logging mode "0". + DietPi-Software | DietPi-RAMlog: Enable and start RAMlog tmpfs directly which allows us to clean the /var/log mountpoint priorly. + DietPi-Software | DietPi-RAMlog: Do never run "systemctl daemon-reload" during boot process (from within dietpi-ramlog_disable.service) which can mess the currently running boot order and is also not required here. + DietPi-Software | DietPi-RAMlog: Minor coding and wording --- dietpi/dietpi-software | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 012efaab06..83e69f3017 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6711,13 +6711,21 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Banner_Installing - l_message='Copy /var/log skeletons to temporary storage' G_RUN_CMD /DietPi/dietpi/func/dietpi-ramlog 1 - # Install (add tmpfs mount to fstab) + # Install persistent tmpfs local tmpfs_max_size=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_RAMLOG_MAXSIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') - sed -i '/[[:space:]]\/var\/log[[:space:]]/d' /etc/fstab + tmpfs_max_size=${tmpfs_max_size:=50} + sed -i '/[[:blank:]]\/var\/log[[:blank:]]/d' /etc/fstab echo "tmpfs /var/log tmpfs defaults,size=${tmpfs_max_size}m,noatime,nodev,nosuid,mode=1777 0 0" >> /etc/fstab + + # Enable DietPi-RAMdisk systemctl enable dietpi-ramlog + # To assure a cleaned mountpoint we need to start RAMlog now + l_message='Storing /var/log metadata to disk' G_RUN_CMD /DietPi/dietpi/func/dietpi-ramlog 1 + l_message='Cleaning /var/log mountpoint' G_RUN_CMD rm -Rf /var/log/{,.??,.[^.]}* + l_message='Mounting tmpfs to /var/log' G_RUN_CMD mount /var/log + l_message='Restoring metadata to /var/log tmpfs' G_RUN_CMD systemctl start dietpi-ramlog + fi software_id=101 @@ -14601,31 +14609,28 @@ _EOF_ fi - software_id=103 + software_id=103 # DietPi-RAMlog if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - sed -i '/\/var\/log/c\#\/var\/log DietPi-RAMlog disabled' /etc/fstab + sed -i '/[[:blank:]]\/var\/log[[:blank:]]/d' /etc/fstab - # - Boot service to allow dietpi-ramlog to start and copy skeletons back to /var/log, then finally disable ramlog cat << _EOF_ > /etc/systemd/system/dietpi-ramlog_disable.service [Unit] -Description=DietPi - Boot service to allow dietpi-ramlog to start and copy skeletons back to /var/log, then finally disable ramlog +Description=DietPi-RAMlog_disable | Disables DietPi-RAMlog after it has restored log metadata back to /var/log After=dietpi-ramlog.service dietpi-ramdisk.service Requires=dietpi-ramdisk.service -Before=dietpi-boot.service rsyslog.service syslog.service +Before=dietpi-preboot.service rsyslog.service syslog.service [Service] Type=oneshot -RemainAfterExit=yes StandardOutput=tty ExecStart=/bin/bash -c '/var/lib/dietpi/dietpi-ramlog/disable.sh &> /var/tmp/dietpi/logs/dietpi-ramlog_disable_debug.log' [Install] WantedBy=local-fs.target _EOF_ - systemctl daemon-reload systemctl enable dietpi-ramlog_disable @@ -14634,14 +14639,12 @@ _EOF_ { systemctl stop dietpi-ramlog systemctl disable dietpi-ramlog - rm -R /var/tmp/dietpi/logs/dietpi-ramlog_store/* + rm -R /var/tmp/dietpi/logs/dietpi-ramlog_store systemctl disable dietpi-ramlog_disable rm /etc/systemd/system/dietpi-ramlog_disable.service - systemctl daemon-reload rm /var/lib/dietpi/dietpi-ramlog/disable.sh } _EOF_ - chmod +x /var/lib/dietpi/dietpi-ramlog/disable.sh fi @@ -14742,7 +14745,7 @@ _EOF_ fi - if grep -q '#/var/log' /etc/fstab && + if ! grep -q '[[:blank:]]/var/log[[:blank:]]' /etc/fstab && ! grep -q '^rsyslog' $fp_temp && ! grep -q '^logrotate' $fp_temp; then From 81281d3c08f4e35505981a1cb7e10f0bf3c1883b Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 10 Mar 2019 17:07:57 +0100 Subject: [PATCH 174/232] v6.22 + CHANGELOG | DietPi-RAMlog --- CHANGELOG.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f768727458..5a80f83f53 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -17,6 +17,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Deluge: Reworked the installer to better match the Debian package defaults and recommendations/examples from official docs. Deluge now runs as user "debian-deluged", logs have been moved to "/var/log/deluged/" and the init.d service with its traces are removed, which are all pre-generated by the Debian APT package. The systemd units have been adjusted according to the official Deluge documentation. These changes are applied as well to existing installs during DietPi update, the old user "deluge" and obsolete configurations are removed. Your active configurations and data are preserved, the installer has been as well enhanced to better handle existing installs and never touch existing configs. Note that access to the Deluge console has to be done as user "debian-deluged" (sudo -u debian-deluged deluge-console). A related access issue to the console has been fixed by this as well. Many thanks to @seanmikhaels for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5525 - DietPi-Software | AmiBerry: Updated to latest version (2.25), thanks @midwan: https://github.com/MichaIng/DietPi/issues/2599 - DietPi-Software | Netdata: On Debian Stretch/Buster and Raspbian Buster an up-to-date APT package is available, which will now be installed instead of our custom build. Many thanks to @74cmonty for this information: https://github.com/MichaIng/DietPi/issues/2446 +- DietPi-Software | DietPi-RAMlog: When installing/enabling RAMlog, the /var/log mountpoint will be now cleaned before mounting the tmpfs on it, while preserving the existing logs metadata. This resolves a warning on early boot stage and frees the disk space consumed by the disk log before. Bug Fixes: - System | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2529 @@ -38,6 +39,7 @@ Bug Fixes: - DietPi-Software | Pi-hole: Resolved an issue where "pihole -up" fails because of wrong file permissions. Many thanks to @jonare77 for resporting this issue: https://github.com/MichaIng/DietPi/issues/2516 - DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service to ensure the MPD user can use both dietpi and audio groups: https://github.com/MichaIng/DietPi/issues/2462 - DietPi-Software | Airsonic: Resolved an issue where during install the FFmpeg transcoder symlink could be placed wrong, leading to a failing Airsonic start. Many thanks to @pecan_pie for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5637 +- DietPi-Software | DietPi-RAMlog: Fixed an issue where logging mode could be set wrong when uninstalling and reinstalling RAMlog. Many thanks to @abecvar for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5666 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pulls?q=is%3Aclosed+base%3Amaster From dad12fc612103449469ef9ccddb6290331169a02 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 10 Mar 2019 19:57:33 +0100 Subject: [PATCH 175/232] v6.22 + DietPi-Software | DietPi-RAMlog: Pre-create "/var/lib/dietpi/dietpi-ramlog" before attempting to place "disable.sh" inside. --- dietpi/dietpi-software | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 83e69f3017..9576471ba3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -14634,6 +14634,7 @@ _EOF_ systemctl daemon-reload systemctl enable dietpi-ramlog_disable + mkdir -p /var/lib/dietpi/dietpi-ramlog cat << _EOF_ > /var/lib/dietpi/dietpi-ramlog/disable.sh #!/bin/bash { From 65f0ace42ffd9e61c8bb9ebc5e82eaee08c86687 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 11 Mar 2019 15:01:22 +0100 Subject: [PATCH 176/232] v6.22 + Raise RC version --- dietpi/server_version-6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index 6537feb98a..6dccc4a2f2 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 22 -0 +1 From b37b39b4fb773901d593d87368ac210a29927ba3 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 11 Mar 2019 15:02:09 +0100 Subject: [PATCH 177/232] v6.22 + DietPi-Globals | Raise default RC version --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index fae7f640c3..1588f5722e 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -64,7 +64,7 @@ G_GITOWNER=${G_GITOWNER:-MichaIng} G_DIETPI_VERSION_CORE=${G_DIETPI_VERSION_CORE:-6} G_DIETPI_VERSION_SUB=${G_DIETPI_VERSION_SUB:-22} - G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-0} + G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-1} [[ -f '/DietPi/dietpi/.version' && $(sed -n 1p /DietPi/dietpi/.version) == '#!/bin/bash' ]] && . /DietPi/dietpi/.version G_VERSIONDB_SAVE(){ From ec240df71daf41afb5ad540f4f949b504f36d887 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 11 Mar 2019 15:08:29 +0100 Subject: [PATCH 178/232] v6.22 + DietPi-Software | WireGuard: Add Rock64 kernel package besides headers (currently disabled anyway) --- dietpi/dietpi-software | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9576471ba3..1f9cebfc01 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4869,8 +4869,7 @@ _EOF_ fi - #WireGuard - software_id=172 + software_id=172 # WireGuard if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4910,7 +4909,7 @@ _EOF_ # - Rock64 elif (( $G_HW_MODEL == 43 )); then - kernel_packages='linux-headers-rockchip64' + kernel_packages='linux-image-rockchip64 linux-headers-rockchip64' fi @@ -4947,8 +4946,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #DietPi-NordVPN - software_id=171 + software_id=171 # DietPi-NordVPN if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4962,8 +4960,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #LETSENCRYPT - software_id=92 + software_id=92 # Let's Encrypt if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing From 2cacbfe7b2ee9fdec6ab628ea942140bce61a453 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 11 Mar 2019 18:05:37 +0100 Subject: [PATCH 179/232] v6.22 + DietPi-Benchmark | Survey settings now contain opt-in/out value only + DietPi-Benchmark | Failsafe survey opt-in/out value handling + DietPi-Benchmark | Add missing $FP_TEMP: Now the temp CPU benchmark script + results are stored in default working dir: /tmp/$G_PROGRAM_NAME --- dietpi/func/dietpi-benchmark | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark index 020e0766e3..4a1202fe80 100644 --- a/dietpi/func/dietpi-benchmark +++ b/dietpi/func/dietpi-benchmark @@ -46,6 +46,7 @@ BENCH_FILESIZE=${BENCH_FILESIZE:-0} #optional input for automated FP_BENCHFILE=${FP_BENCHFILE:-/} #optional input for automated + FP_TEMP="/tmp/$G_PROGRAM_NAME" # CPU benchmark files BENCH_ROOTFS_WRITE='Not tested' BENCH_ROOTFS_READ='Not tested' BENCH_RAM_WRITE='Not tested' @@ -60,11 +61,7 @@ Load_Results(){ - if [[ -f /var/lib/dietpi/dietpi-benchmark/results ]]; then - - . /var/lib/dietpi/dietpi-benchmark/results - - fi + [[ -f /var/lib/dietpi/dietpi-benchmark/results ]] && . /var/lib/dietpi/dietpi-benchmark/results } @@ -93,11 +90,7 @@ _EOF_ Update_Survey_Opted_Status(){ - if [[ -f /DietPi/dietpi/.dietpi-survey ]]; then - - SURVEY_OPTED_IN=$(sed -n 1p /DietPi/dietpi/.dietpi-survey) - - fi + [[ -f /DietPi/dietpi/.dietpi-survey ]] && SURVEY_OPTED_IN=$( Date: Tue, 12 Mar 2019 04:29:42 +0100 Subject: [PATCH 180/232] v6.22 (#2633) + DietPi-Software | rTorrent: Resolved an issue where the ruTorrent web UI could not connect to the rTorrent daemon. Many thanks to @Chester007 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5656 + DietPi-Software | rTorrent: Runs now as user "rtorrent" and creates files as group "dietpi" with 775/664 permissions. Enabled Buster support and enhanced config file handling on reinstall --- CHANGELOG.txt | 2 + dietpi/dietpi-software | 220 +++++++++++++++++++------------- dietpi/func/dietpi-set_software | 48 +++---- dietpi/patch_file | 12 +- 4 files changed, 164 insertions(+), 118 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5a80f83f53..d0982b7471 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -18,6 +18,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | AmiBerry: Updated to latest version (2.25), thanks @midwan: https://github.com/MichaIng/DietPi/issues/2599 - DietPi-Software | Netdata: On Debian Stretch/Buster and Raspbian Buster an up-to-date APT package is available, which will now be installed instead of our custom build. Many thanks to @74cmonty for this information: https://github.com/MichaIng/DietPi/issues/2446 - DietPi-Software | DietPi-RAMlog: When installing/enabling RAMlog, the /var/log mountpoint will be now cleaned before mounting the tmpfs on it, while preserving the existing logs metadata. This resolves a warning on early boot stage and frees the disk space consumed by the disk log before. +- DietPi-Software | rTorrent: Runs now as user "rtorrent" and creates files as group "dietpi" with 775/664 permissions. Enabled Buster support and enhanced config file handling on reinstall: https://github.com/MichaIng/DietPi/pull/2633 Bug Fixes: - System | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2529 @@ -40,6 +41,7 @@ Bug Fixes: - DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service to ensure the MPD user can use both dietpi and audio groups: https://github.com/MichaIng/DietPi/issues/2462 - DietPi-Software | Airsonic: Resolved an issue where during install the FFmpeg transcoder symlink could be placed wrong, leading to a failing Airsonic start. Many thanks to @pecan_pie for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5637 - DietPi-Software | DietPi-RAMlog: Fixed an issue where logging mode could be set wrong when uninstalling and reinstalling RAMlog. Many thanks to @abecvar for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5666 +- DietPi-Software | rTorrent: Resolved an issue where the ruTorrent web UI could not connect to the rTorrent daemon. Many thanks to @Chester007 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5656 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pulls?q=is%3Aclosed+base%3Amaster diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1f9cebfc01..f0200f6ed2 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -778,7 +778,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='web interface audio streamer' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=7305#p7305' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7305#p7305' aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 @@ -921,7 +921,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=2603#p2603' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2603#p2603' #------------------ software_id=116 @@ -951,7 +951,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='nzb download manager' aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=6747#p6747' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ @@ -5389,31 +5389,47 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #RTORRENT - software_id=107 + software_id=107 # rTorrent if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - DEPS_LIST='rtorrent screen' #mediainfo - # On Jessie, nginx-full is needed for SCGI module: https://github.com/MichaIng/DietPi/issues/1240 + DEPS_LIST='rtorrent' #mediainfo + # On Buster, no "screen" is required to run rTorrent as daemon: https://github.com/rakshasa/rtorrent/wiki/Daemon_Mode + (( $G_DISTRO < 5 )) && DEPS_LIST+=' screen' + # On Jessie, nginx-full is required for SCGI module: https://github.com/MichaIng/DietPi/issues/1240 (( $G_DISTRO < 4 && ${aSOFTWARE_INSTALL_STATE[85]} > 0 )) && DEPS_LIST+=' nginx-full' - # Get current version string + # Install ruTorrent: Web UI for rTorrent + # - Get current version string INSTALL_URL_ADDRESS='https://api.github.com/repos/Novik/ruTorrent/releases/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" local version_string=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 '^[[:blank:]]*"tag_name":' | cut -d \" -f 4) Download_Install "https://github.com/Novik/ruTorrent/archive/$version_string.tar.gz" - mkdir -p /var/www/rutorrent - mv ruTorrent-*/* /var/www/rutorrent/ - rm -R ruTorrent-* + # - Reinstall + if [[ -d /var/www/rutorrent ]]; then + + # - Backup known config files + G_BACKUP_FP /var/www/rutorrent/conf/config.php + G_BACKUP_FP /var/www/rutorrent/conf/access.ini + G_BACKUP_FP /var/www/rutorrent/conf/plugins.ini + + # - Merge new install into old to preserve e.g. 3rd party plugins + cp -a ruTorrent-*/. /var/www/rutorrent/ + rm -R ruTorrent-* + + # - Fresh install + else + + mv ruTorrent-* /var/www/rutorrent + + fi fi - #Aria2 - software_id=132 + software_id=132 # Aria2 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -10917,25 +10933,20 @@ _EOF_ fi - #RTORRENT - software_id=107 + software_id=107 # rTorrent if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #Create username/password for rutorrent based on webserver type. + # Create username/password for rutorrent based on webserver type. # - Apache2 - if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - - # - Allow overrides redirects and .htaccess - sed -i "/AllowOverride /c\ AllowOverride All" /etc/apache2/sites-enabled/000-default* - sed -i "/AllowOverride /c\ AllowOverride All" /etc/apache2/apache2.conf - - a2enmod rewrite + if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then - #install scgi module + # - Install SCGI module G_AGI libapache2-mod-scgi + a2enmod rewrite scgi + # - Enable password protection htpasswd -cb /etc/.rutorrent-htaccess root "$GLOBAL_PW" cat << _EOF_ > /var/www/rutorrent/.htaccess AuthUserFile /etc/.rutorrent-htaccess @@ -10944,24 +10955,29 @@ AuthType Basic require user root _EOF_ + # - Allow overrides/.htaccess and enable SCGI + authentication cat << _EOF_ > /etc/apache2/sites-available/dietpi-rutorrent.conf + + AllowOverride All + + SCGIMount /RPC2 127.0.0.1:5000 -AuthName "rTorrent secure access" -AuthType Basic -AuthBasicProvider file -AuthUserFile /etc/.rutorrent-htaccess -Require user root + AuthName "rTorrent secure access" + AuthType Basic + AuthBasicProvider file + AuthUserFile /etc/.rutorrent-htaccess + Require user root _EOF_ a2ensite dietpi-rutorrent - + # - Lighttpd - elif (( ${aSOFTWARE_INSTALL_STATE[84]} >= 1 )); then + elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )); then echo "root:rtorrent:$(echo -n 'root:rtorrent:dietpi' | md5sum | cut -b -32)" > /etc/.rutorrent-htaccess - # - add to /etc/lighttpd/lighttpd.conf + # - Add to /etc/lighttpd/lighttpd.conf if ! grep -qi '^#RUTORRENT_DIETPI' /etc/lighttpd/lighttpd.conf; then cat << _EOF_ >> /etc/lighttpd/lighttpd.conf @@ -10994,7 +11010,7 @@ _EOF_ fi # - Nginx - elif (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then + elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then echo "root:$(openssl passwd -crypt dietpi)" > /etc/.rutorrent-htaccess @@ -11012,8 +11028,8 @@ _EOF_ fi - # - Define curl location in config.php (for lighttpd and nginx) - sed -i '/"curl"[[:space:]]/c\ "curl" => "/usr/bin/curl",' /var/www/rutorrent/conf/config.php + # - Define curl location in config.php (for Lighttpd and Nginx) + G_CONFIG_INJECT '"curl"[[:blank:]]' ' "curl" => "/usr/bin/curl",' /var/www/rutorrent/conf/config.php chown www-data:www-data /etc/.rutorrent-htaccess chmod 400 /etc/.rutorrent-htaccess @@ -11021,65 +11037,87 @@ _EOF_ # - Session folder mkdir -p $G_FP_DIETPI_USERDATA/downloads/.session + # Create rTorrent run user + local usercmd='useradd -rM' + getent passwd rtorrent &> /dev/null && usercmd='usermod' + $usercmd rtorrent -G dietpi -d $G_FP_DIETPI_USERDATA/rtorrent -s $(command -v nologin) + # - Service using screen | '/usr/bin/rtorrent &> /var/log/rtorrent.log &' doesnt work, hangs program after 5 seconds cat << _EOF_ > /etc/systemd/system/rtorrent.service [Unit] Description=rTorrent (DietPi) -After=network.target +Wants=network-online.target +After=network-online.target [Service] Type=forking +User=rtorrent +Group=dietpi KillMode=none -ExecStart=/usr/bin/screen -d -m -fa -S rtorrent /usr/bin/rtorrent -ExecStop=/usr/bin/killall -w -s 2 /usr/bin/rtorrent -WorkingDirectory=%h +ExecStart=$(command -v screen) -fa -dmS rtorrent $(command -v rtorrent) +ExecStop=$(command -v screen) -S rtorrent -X quit [Install] WantedBy=multi-user.target _EOF_ - systemctl daemon-reload + # - On Buster we use new daemon mode + if (( $G_DISTRO > 4 )); then - #Default conf - cat << _EOF_ > $HOME/.rtorrent.rc -#Attempt to reduce disk throttling/abuse | 0.9.2 command does not exist -#max_open_files = 50 + sed -Ei '/^(Type|KillMode|ExecStop)=/d' /etc/systemd/system/rtorrent.service + G_CONFIG_INJECT 'ExecStart=' "ExecStart=$(command -v rtorrent)" /etc/systemd/system/rtorrent.service -#Max queue + fi + systemctl daemon-reload + + # - Default conf, do not overwrite if existent + # Example: https://github.com/rakshasa/rtorrent/blob/master/doc/rtorrent.rc + # Deprecated commands: + # - https://github.com/rakshasa/rtorrent/wiki/rTorrent-0.9-Comprehensive-Command-list-(WIP) + # - https://github.com/rakshasa/rtorrent/blob/master/doc/scripts/update_commands_0.9.sed + mkdir -p $G_FP_DIETPI_USERDATA/rtorrent + [[ -f $G_FP_DIETPI_USERDATA/rtorrent/.rtorrent.rc ]] || cat << _EOF_ > $G_FP_DIETPI_USERDATA/rtorrent/.rtorrent.rc +# Attempt to reduce disk throttling/abuse +network.max_open_files.set = 50 + +# Max queue scheduler.max_active.set = 3 -#byte value -max_memory_usage = $(( $(Optimize_BitTorrent 0) * 1024 * 1024 )) +# byte value +pieces.memory.max.set = $(( $(Optimize_BitTorrent 0) * 1024 * 1024 )) # Maximum and minimum number of peers to connect to per torrent. -min_peers = 1 -max_peers = $(( $(Optimize_BitTorrent 2) / 2 + 1 )) +throttle.min_peers.normal.set = 1 +throttle.max_peers.normal.set = $(( $(Optimize_BitTorrent 2) / 2 + 1 )) # Same as above but for seeding completed torrents (-1 = same as downloading) -min_peers_seed = -1 -max_peers_seed = -1 +throttle.min_peers.seed.set = -1 +throttle.max_peers.seed.set = -1 # Maximum number of simultaneous downloads -max_downloads_global = $(Optimize_BitTorrent 2) +throttle.max_downloads.set = $(Optimize_BitTorrent 2) # Maximum number of simultaneous uploads -max_uploads_global = $(Optimize_BitTorrent 3) +throttle.max_uploads.set = $(Optimize_BitTorrent 3) # Global upload and download rate in KiB. "0" for unlimited. -download_rate = 0 -upload_rate = 0 +throttle.global_down.max_rate.set_kb = 0 +throttle.global_up.max_rate.set_kb = 0 # Default directory to save the downloaded torrents. -directory = $G_FP_DIETPI_USERDATA/downloads +directory.default.set = $G_FP_DIETPI_USERDATA/downloads # Default session directory. Make sure you don't run multiple instance # of rtorrent using the same session directory. Perhaps using a # relative path? -session = $G_FP_DIETPI_USERDATA/downloads/.session +session.path.set = $G_FP_DIETPI_USERDATA/downloads/.session + +# UMask +system.umask.set = 002 # Close torrents when diskspace is low. -schedule = low_diskspace,5,60,close_low_diskspace=1000M +schedule2 = low_diskspace,5,60,close_low_diskspace=1000M # Periodically save session data -schedule = session_save,240,300,session_save= +schedule2 = session_save,240,300,session_save= # Enable the default ratio group. ratio.enable=yes @@ -11092,16 +11130,16 @@ ratio.max.set=125 ratio.upload.set=1M # When seeding ratio is reached close the torrent -system.method.set = group.seeding.ratio.command, d.close= +method.set = group.seeding.ratio.command,d.close= # Move files to ./unsorted when download completes -system.method.set_key = event.download.finished,move_complete,"execute=mv,-n,$d.get_base_path=,./unsorted/;d.set_directory=./unsorted/" +method.set_key = event.download.finished,move_complete,"execute=mv,-n,$d.get_base_path=,./unsorted/;d.set_directory=./unsorted/" # Port range to use for listening. -port_range = 33101-33199 +network.port_range.set = 33101-33199 # Start opening ports at a random position within the port range. -port_random = yes +network.port_random.set = yes # Encryption options, set to none (default) or any combination of the following: # allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext @@ -11110,7 +11148,7 @@ port_random = yes # outgoing connections but retries with encryption if they fail, preferring # plaintext to RC4 encryption after the encrypted handshake # -encryption = require +protocol.encryption.set = require # Sort the main view by ratio view.sort_current = main,greater=d.get_ratio= @@ -11134,36 +11172,42 @@ view.sort_new = leeching,less=d.get_name= view.filter = active,d.get_peers_connected= view.sort = active -schedule = sort_main,11,5,view.sort=main -schedule = sort_seeding,12,5,view.sort=seeding -schedule = sort_leeching,13,5,view.sort=leeching -schedule = sort_active,14,5,view.sort=active +schedule2 = sort_main,11,5,view.sort=main +schedule2 = sort_seeding,12,5,view.sort=seeding +schedule2 = sort_leeching,13,5,view.sort=leeching +schedule2 = sort_active,14,5,view.sort=active # Enable DHT support for trackerless torrents or when all trackers are down. # May be set to "disable" (completely disable DHT), "off" (do not start DHT), # "auto" (start and stop DHT as needed), or "on" (start DHT immediately). # The default is "off". For DHT to work, a session directory must be defined. # -dht = auto +dht.mode.set = auto # UDP port to use for DHT. # -#dht_port = 6881 +#dht.port.set = 6881 # Enable peer exchange (for torrents not marked private) # -peer_exchange = yes - -#Enable remote access (eg: webui) -scgi_port = localhost:5000 +protocol.pex.set = yes +# SCGI Connectivity (for alternative rtorrent interfaces, XMLRPC) +# +# Use a IP socket with scgi_port, or a Unix socket with scgi_local. +# schedule can be used to set permissions on the unix socket. +# +scgi_port = 127.0.0.1:5000 +#scgi_local = /home/user/rtorrent/rpc.socket +#schedule2 = scgi_permission,0,0,"execute.nothrow=chmod,\"g+w,o=\",/home/user/rtorrent/rpc.socket" _EOF_ - + # On Buster use new daemon mode + (( $G_DISTRO > 4 )) && G_CONFIG_INJECT 'system.daemon.set[[:blank:]=]' 'system.daemon.set = true' $G_FP_DIETPI_USERDATA/rtorrent/.rtorrent.rc + chown -R rtorrent:rtorrent $G_FP_DIETPI_USERDATA/rtorrent fi - #Aria2 - software_id=132 + software_id=132 # Aria2 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -14062,28 +14106,28 @@ _EOF_ fi - software_id=107 + software_id=107 # rTorrent if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP rtorrent - rm -R /var/www/rutorrent - rm $HOME/.rtorrent.rc - rm /etc/systemd/system/rtorrent.service + [[ -d /var/www/rutorrent ]] && rm -R /var/www/rutorrent + [[ -d $G_FP_DIETPI_USERDATA/rtorrent ]] && rm -R $G_FP_DIETPI_USERDATA/rtorrent + [[ -f /etc/systemd/system/rtorrent.service ]] && rm /etc/systemd/system/rtorrent.service - # - webserver rutorrent user/pw settings - rm /etc/.rutorrent-htaccess + # - Webserver rutorrent user/pw settings + [[ -f /etc/.rutorrent-htaccess ]] && rm /etc/.rutorrent-htaccess - # lighttpd + # Lighttpd #Remove from #RUTORRENT_DIETPI to #RUTORRENT_DIETPI in /etc/lighttpd/lighttpd.conf - # nginx - rm /etc/nginx/sites-dietpi/dietpi-rutorrent.conf + # Nginx + [[ -f /etc/nginx/sites-dietpi/dietpi-rutorrent.conf ]] && rm /etc/nginx/sites-dietpi/dietpi-rutorrent.conf - # apache2 + # Apache2 command -v a2dissite &> /dev/null && a2dissite dietpi-rutorrent - rm /etc/apache2/sites-available/dietpi-rutorrent.conf + [[ -f /etc/apache2/sites-available/dietpi-rutorrent.conf ]] && rm /etc/apache2/sites-available/dietpi-rutorrent.conf fi diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 3fcab5f7b1..eab42932f3 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -299,7 +299,7 @@ _EOF_ # - DietPi-Software secure global_pw encrypted chown root:root /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin - chmod 700 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin + chmod 600 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin # - /var/www / www-data chown -R www-data:www-data /var/www @@ -308,12 +308,9 @@ _EOF_ #Apply non-root permissions for files and folders in G_FP_DIETPI_USERDATA # - dietpi user - chown -R dietpi:dietpi /home/dietpi - chown -R dietpi:dietpi $G_FP_DIETPI_USERDATA - chmod -R 775 $G_FP_DIETPI_USERDATA - # + for symlinked locations - chown -R dietpi:dietpi $G_FP_DIETPI_USERDATA/* - chmod -R 775 $G_FP_DIETPI_USERDATA/* + # Include symlinked locations via $G_FP_DIETPI_USERDATA/* + chown -R dietpi:dietpi /home/dietpi $G_FP_DIETPI_USERDATA $G_FP_DIETPI_USERDATA/* + chmod -R 775 $G_FP_DIETPI_USERDATA $G_FP_DIETPI_USERDATA/* # - Apply program specific permissions # NB: Following should be ordered ascending by index to prevent dupes. @@ -322,7 +319,7 @@ _EOF_ chown -R 775 /var/lib/dietpi/dietpi-software/installed/desktop # Set execute to prevent "untrusted" prompt in Mate, and possibily other desktops. chmod +x /usr/share/applications/* - chmod +x $HOME/Desktop/* + chmod +x /root/Desktop/* # - O!MPD, requires write permissions chmod -R 777 /var/www/ompd/tmp #(required for database update) @@ -385,17 +382,13 @@ _EOF_ chown -R influxdb:influxdb $G_FP_DIETPI_USERDATA/influxdb # - gogs - chown -R gogs:gogs /etc/gogs - chown -R gogs:gogs $G_FP_DIETPI_USERDATA/gogs-repo - chown -R gogs:gogs /var/log/gogs + chown -R gogs:gogs /etc/gogs $G_FP_DIETPI_USERDATA/gogs-repo /var/log/gogs # - ubooquity chown -R ubooquity:dietpi $G_FP_DIETPI_USERDATA/ubooquity # - Mineos - chown -R mineos:dietpi $G_FP_DIETPI_USERDATA/mineos - chown -R mineos:dietpi /var/games/minecraft - chown mineos:dietpi /etc/ssl/certs/mineos* + chown -R mineos:dietpi $G_FP_DIETPI_USERDATA/mineos /var/games/minecraft /etc/ssl/certs/mineos* # - cubrite chown -R cuberite:dietpi $G_FP_DIETPI_USERDATA/cubrite @@ -408,23 +401,16 @@ _EOF_ chown -R medusa:dietpi $G_FP_DIETPI_USERDATA/medusa # - Sonarr - chown -R sonarr:dietpi $G_FP_DIETPI_USERDATA/sonarr - chown -R sonarr:dietpi /opt/NzbDrone - chown -R sonarr:dietpi /var/log/sonarr + chown -R sonarr:dietpi $G_FP_DIETPI_USERDATA/sonarr /opt/NzbDrone /var/log/sonarr # - Radarr - chown -R radarr:dietpi $G_FP_DIETPI_USERDATA/radarr - chown -R radarr:dietpi /opt/Radarr - chown -R radarr:dietpi /var/log/radarr + chown -R radarr:dietpi $G_FP_DIETPI_USERDATA/radarr /opt/Radarr /var/log/radarr # - Lidarr - chown -R lidarr:dietpi $G_FP_DIETPI_USERDATA/lidarr - chown -R lidarr:dietpi /opt/Lidarr - chown -R lidarr:dietpi /var/log/lidarr + chown -R lidarr:dietpi $G_FP_DIETPI_USERDATA/lidarr /opt/Lidarr /var/log/lidarr # - Tonido - chown -R tonido:dietpi $G_FP_DIETPI_USERDATA/tonido - chown -R tonido:dietpi /home/tonido + chown -R tonido:dietpi $G_FP_DIETPI_USERDATA/tonido /home/tonido # - NZBget chown -R nzbget:dietpi $G_FP_DIETPI_USERDATA/nzbget @@ -452,13 +438,17 @@ _EOF_ # - qBitTorrent chown -R qbittorrent:dietpi /home/qbittorrent + # - rTorrent + chown -R rtorrent:rtorrent $G_FP_DIETPI_USERDATA/rtorrent $G_FP_DIETPI_USERDATA/downloads/.session + # ruTorrent web access + chown www-data:www-data /etc/.rutorrent-htaccess + chmod 400 /etc/.rutorrent-htaccess + # - FAHClient (Folding@Home) - chown -R fahclient:dietpi $G_FP_DIETPI_USERDATA/fahclient - chown fahclient:dietpi /var/log/fahclient.log + chown -R fahclient:dietpi $G_FP_DIETPI_USERDATA/fahclient /var/log/fahclient.log # - Sabnzbd - chown -R sabnzbd:dietpi /etc/sabnzbd - chown -R sabnzbd:dietpi /var/log/sabnzbd + chown -R sabnzbd:dietpi /etc/sabnzbd /var/log/sabnzbd # - Blynk chown -R blynk:dietpi $G_FP_DIETPI_USERDATA/blynk diff --git a/dietpi/patch_file b/dietpi/patch_file index 0e9e8dbe5e..9cb8af41f9 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1679,10 +1679,21 @@ _EOF_ #Reinstalls # Amiberry 2.25: https://github.com/MichaIng/DietPi/issues/2599 # Deluge: Patch according to installer rework: https://github.com/MichaIng/DietPi/pull/2594 + # rTorrent: https://github.com/MichaIng/DietPi/issues/2629 if (( $G_DIETPI_INSTALL_STAGE == 2 )); then local reinstall_indices='108' + if grep -q '^aSOFTWARE_INSTALL_STATE\[107\]=2' /DietPi/dietpi/.installed && + [[ -f /root/.rtorrent.rc ]]; then + + reinstall_indices+=' 107' + G_CONFIG_INJECT 'system.umask.set[[:blank:]=]' 'system.umask.set = 002' /root/.rtorrent.rc + mkdir -p $G_FP_DIETPI_USERDATA/rtorrent + mv /root/.rtorrent.rc $G_FP_DIETPI_USERDATA/rtorrent/ + + fi + if grep -q '^aSOFTWARE_INSTALL_STATE\[45\]=2' /DietPi/dietpi/.installed && getent passwd deluge &> /dev/null; then # Only do this once, regardless of re-patches @@ -1714,7 +1725,6 @@ NB: When accessing "deluge-console" you need to do that as user "debian-deluged" fi #------------------------------------------------------------------------------- - fi #------------------------------------------------------------------------------- From 419657182bbf61e96bcaad77606262ceb922286c Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 12 Mar 2019 11:36:11 +0000 Subject: [PATCH 181/232] v6.22 General | CPU temps (if available on the device) now displayed in the login banners. Many thanks to esturniolo for the suggestion: https://twitter.com/esturniolo/status/1104912062298423297 + Clean up of banner code + Globalize cpu temp colour print out --- CHANGELOG.txt | 3 +- dietpi/dietpi-cpuinfo | 40 ++------------------------ dietpi/func/dietpi-banner | 57 +++++++++++++------------------------- dietpi/func/dietpi-globals | 33 +++++++++++++++++++++- 4 files changed, 56 insertions(+), 77 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5a80f83f53..67b57307b7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ v6.22 Changes / Improvements / Optimisations: - Security | The DietPi-Software global password is now stored with enhanced security which also resolves a warning on Buster systems: https://github.com/MichaIng/DietPi/issues/2213 - General | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives. This allows us to lower DietPi core package dependencies from "p7zip-full" to "p7zip". +- General | CPU temps (if available on the device) now displayed in the login banners. Many thanks to esturniolo for the suggestion: https://twitter.com/esturniolo/status/1104912062298423297 - DietPi-NordVPN | Added sent/received usage stats for VPN tunnel. - DietPi-Sync | Sync will now abort if the source dir is empty. Merged dry run into real sync, as this was performed anyway to do required free space check. When "Sync" is selected, after dry run the user is presented a summary and given the option to view the detailed dry run log, cancel or continue with real sync. Some other minor fixes and enhancements have been applied as well. Many thanks to @midnightwatcher for doing this request: https://dietpi.com/phpbb/viewtopic.php?f=12&t=5588 - DietPi-Software | Emby Server: Now installs the latest version automatically (currently 4.0.2) which as well offers a native ARMv8 package: https://github.com/MichaIng/DietPi/pull/2525 @@ -39,7 +40,7 @@ Bug Fixes: - DietPi-Software | Pi-hole: Resolved an issue where "pihole -up" fails because of wrong file permissions. Many thanks to @jonare77 for resporting this issue: https://github.com/MichaIng/DietPi/issues/2516 - DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service to ensure the MPD user can use both dietpi and audio groups: https://github.com/MichaIng/DietPi/issues/2462 - DietPi-Software | Airsonic: Resolved an issue where during install the FFmpeg transcoder symlink could be placed wrong, leading to a failing Airsonic start. Many thanks to @pecan_pie for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5637 -- DietPi-Software | DietPi-RAMlog: Fixed an issue where logging mode could be set wrong when uninstalling and reinstalling RAMlog. Many thanks to @abecvar for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5666 +- DietPi-Software | DietPi-RAMlog: Fixed an issue where logging mode could be set wrong when uninstalling and reinstalling RAMlog. Many thanks to @abecvar for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5666 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pulls?q=is%3Aclosed+base%3Amaster diff --git a/dietpi/dietpi-cpuinfo b/dietpi/dietpi-cpuinfo index 320f1c1200..5d297bdcf9 100644 --- a/dietpi/dietpi-cpuinfo +++ b/dietpi/dietpi-cpuinfo @@ -102,46 +102,10 @@ } - CPU_TEMP_CURRENT='N/A' - CPU_TEMP_PRINT='N/A' + CPU_TEMP_PRINT='' Obtain_Cpu_Temp(){ - CPU_TEMP_CURRENT=$(G_OBTAIN_CPU_TEMP) - - if disable_error=1 G_CHECK_VALIDINT "$CPU_TEMP_CURRENT"; then - - local cpu_temp_current_f=$(( $CPU_TEMP_CURRENT * 9/5 + 32 )) - if (( $CPU_TEMP_CURRENT >= 70 )); then - - CPU_TEMP_PRINT="\e[1;31mWarning: $CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f | Reducing the life of your device.\e[0m" - - elif (( $CPU_TEMP_CURRENT >= 60 )); then - - CPU_TEMP_PRINT="\e[38;5;202m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[90m | Running hot, not recommended.\e[0m" - - elif (( $CPU_TEMP_CURRENT >= 50 )); then - - CPU_TEMP_PRINT="\e[1;33m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[0m \e[90m | Running warm, but safe.\e[0m" - - elif (( $CPU_TEMP_CURRENT >= 40 )); then - - CPU_TEMP_PRINT="\e[1;32m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[0m\e[90m | Optimal temperature.\e[0m" - - elif (( $CPU_TEMP_CURRENT >= 30 )); then - - CPU_TEMP_PRINT="\e[1;36m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[0m\e[90m | Cool runnings.\e[0m" - - else - - CPU_TEMP_PRINT="\e[1;36m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f \e[0m \e[90m| Who put me in the freezer!\e[0m" - - fi - - else - - CPU_TEMP_PRINT=$CPU_TEMP_CURRENT - - fi + CPU_TEMP_PRINT=$(print_full_info=1 G_OBTAIN_CPU_TEMP) } diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index defb25240f..6ae252d9cc 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -46,7 +46,6 @@ UPDATE_AVAILABLE=0 UPDATE_AVAILABLE_VERSION='' # -1 = image required, other value = latest version - Obtain_Update_Available(){ # Update Available @@ -59,57 +58,44 @@ } - Hardware_Model_Print(){ - - echo -e " \e[1mv$DIETPI_VERSION\e[0m \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m\n \e[38;5;154m────────────────────────────────────────────────\e[0m" + Print_Header(){ - } + local green_line='\e[38;5;154m─────────────────────────────────────────────────────\e[0m' - IPAddress_Print(){ + Obtain_Update_Available # Try to re-obtain IP if missing [[ $IP_ADDRESS ]] || Update_Ip_Address - echo -e " \e[1m$IP_ADAPTER\e[0m \e[90m| $IP_ADDRESS\e[0m\n \e[38;5;154m────────────────────────────────────────────────\e[0m" - - } - - #///////////////////////////////////////////////////////////////////////////////////// - # Banner Print - #///////////////////////////////////////////////////////////////////////////////////// - TEXT_TOP='' - - Banner_TopText_Extras(){ - - # Update Available + # Update Available? + local text_update_available_date='' if (( $UPDATE_AVAILABLE )); then if [[ $UPDATE_AVAILABLE_VERSION == '-1' ]]; then - TEXT_TOP='\e[90m| \e[1;33mImage available\e[0m' + text_update_available_date='\e[1;33mImage available\e[0m' else - TEXT_TOP='\e[90m| \e[1;33mUpdate available\e[0m' + text_update_available_date='\e[1;33mUpdate available\e[0m' fi - # Use TEXT_TOP for storing helpful info else - # Helpful mode - TEXT_TOP="\e[90m| $(date +"%a %x - %R")\e[0m" + text_update_available_date="$(date +"%a %x - %R")" fi - } - Banner_Dietpi(){ - - (( $INPUT == 1 )) && printf '\ec' # clear current terminal screen - - echo -e " \e[38;5;154m────────────────────────────────────────────────\e[0m\n \e[1mDietPi\e[0m $TEXT_TOP\n \e[38;5;154m────────────────────────────────────────────────\e[0m" - Hardware_Model_Print - IPAddress_Print + echo -e "\ + $green_line + \e[1mDietPi v$DIETPI_VERSION\e[0m \e[90m| $text_update_available_date\e[0m + $green_line + \e[1m$G_HW_MODEL_DESCRIPTION\e[0m \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP)\e[0m + $green_line + \e[1m$IP_ADAPTER ($IP_ADDRESS)\e[0m + $green_line +" } @@ -166,15 +152,12 @@ #///////////////////////////////////////////////////////////////////////////////////// if (( $INPUT == 0 )); then - Obtain_Update_Available - Banner_TopText_Extras - Banner_Dietpi + Print_Header elif (( $INPUT == 1 )); then - Obtain_Update_Available - Banner_TopText_Extras - Banner_Dietpi + printf '\ec' # clear current terminal screen + Print_Header Credits_Print fi diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index fae7f640c3..d2d45bcb25 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1835,9 +1835,11 @@ $print_logfile_info } #Returns current CPU temp 'C + # print_full_info=1# optional input to print full colour text output and temp warnings. G_OBTAIN_CPU_TEMP(){ local cpu_temp_current='N/A' #We must always return a value, due to VM lacking this feature + benchmark online + local print_full_info=${print_full_info:-0} # - Array to store possible locations for temp read. afp_temperature=( @@ -1874,6 +1876,35 @@ $print_logfile_info cpu_temp_current='N/A' + elif (( $print_full_info )); then + + local cpu_temp_current_f=$(( $cpu_temp_current * 9/5 + 32 )) + if (( $cpu_temp_current >= 70 )); then + + cpu_temp_current="\e[1;31mWarning: $cpu_temp_current'C : $cpu_temp_current_f'F (Reducing the life of your device)\e[0m" + + elif (( $cpu_temp_current >= 60 )); then + + cpu_temp_current="\e[38;5;202m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running hot, not recommended)\e[0m" + + elif (( $cpu_temp_current >= 50 )); then + + cpu_temp_current="\e[1;33m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running warm, but safe)\e[0m" + + elif (( $cpu_temp_current >= 40 )); then + + cpu_temp_current="\e[1;32m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Optimal temperature)\e[0m" + + elif (( $cpu_temp_current >= 30 )); then + + cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Cool runnings)\e[0m" + + else + + cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Who put me in the freezer!)\e[0m" + + fi + fi break @@ -1884,7 +1915,7 @@ $print_logfile_info unset afp_temperature - echo $cpu_temp_current + echo -e "$cpu_temp_current" } From 9e9c765556cedfc1ea54495a5fbce45835e86bcd Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 14:50:51 +0100 Subject: [PATCH 182/232] v6.22 + DietPi-Software | Minor: Replace all software docs URLs with a short consistent failsafe one (e.g. in case threads per page differ) + DietPi-Software | Minor: Replace all "$HOME" and "~" calls with "/root" since we force root user to run this script anyway. This allows us to run the script outside of a login where no home dir is assigned. "/root" must be root's home even defined in FHS: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard --- dietpi/dietpi-software | 244 ++++++++++++++++++++--------------------- 1 file changed, 122 insertions(+), 122 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f0200f6ed2..9b87c3ce15 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -385,7 +385,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p42' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42' #------------------ software_id=24 @@ -396,7 +396,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=60#p2073' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2073#p2073' #------------------ software_id=25 @@ -407,7 +407,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=70#p2203' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2203#p2203' #------------------ software_id=26 @@ -418,7 +418,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=60#p2072' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2072#p2072' #------------------ software_id=113 @@ -429,7 +429,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=3011#p3011' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3011#p3011' # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -446,7 +446,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=30#p408' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408' # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 @@ -467,7 +467,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=30#p408' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408' #------------------ software_id=29 @@ -477,7 +477,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=70#p2074' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2074#p2074' #------------------ software_id=30 @@ -497,7 +497,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=4149#p4149' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4149#p4149' # - License RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -517,7 +517,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p43' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=43#p43' # - Only RPi + Odroid for ((i=20; i<=$MAX_G_HW_MODEL; i++)) @@ -544,7 +544,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p50' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=50#p50' #------------------ software_id=148 @@ -627,7 +627,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='(MiniDLNA) media streaming server (dlna, upnp)' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p49' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=49#p49' #------------------ software_id=40 @@ -642,7 +642,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=40#p554' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=554#p554' #------------------ software_id=41 @@ -687,7 +687,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='web interface music & radio player' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=80#p3611' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3611#p3611' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ @@ -697,7 +697,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='Turns device into Roon capable audio player' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=80#p4153' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4153#p4153' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # - Disable for ARMv6 @@ -710,7 +710,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='signalyst network audio adaptor (naa)' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=90#p4294' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4294#p4294' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ @@ -910,7 +910,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with web interface (c++)' aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=70#p2272' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2272#p2272' #------------------ software_id=107 @@ -992,7 +992,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='automatically download music' aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=13580#p13580' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13580#p13580' aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 #------------------ @@ -1095,7 +1095,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=70#p2187' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2187#p2187' # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 @@ -1107,7 +1107,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='backup and sync server with web interface' aSOFTWARE_CATEGORY_INDEX[$software_id]=4 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=70#p2363' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2363#p2363' #------------------ software_id=134 @@ -1162,7 +1162,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=5 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=64#p64' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=64#p64' aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 # - Disable for All non-RPi @@ -1186,7 +1186,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p45' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=45#p45' # - Disable for All non-RPi for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -1221,7 +1221,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='minecraft server with web interface (c++)' aSOFTWARE_CATEGORY_INDEX[$software_id]=5 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=60#p2068' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2068#p2068' # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 @@ -1237,7 +1237,7 @@ _EOF_ aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=60#p2069' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2069#p2069' #------------------ software_id=156 @@ -1280,7 +1280,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=5#p51' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=51#p51' #------------------ software_id=55 @@ -1292,7 +1292,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=30#p395' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=395#p395' #------------------ software_id=38 @@ -1304,7 +1304,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=130#p13918' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13918#p13918' #------------------ software_id=56 @@ -1315,7 +1315,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=40#p480' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=480#p480' #------------------ software_id=57 @@ -1327,7 +1327,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=50#p1502' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1502#p1502' #------------------ software_id=58 @@ -1381,7 +1381,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p48' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=48#p48' # - Disable for All non-RPi for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -1446,7 +1446,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='system stats displayed on lcd/panel' aSOFTWARE_CATEGORY_INDEX[$software_id]=9 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p204' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=204#p204' #------------------ software_id=63 @@ -1457,7 +1457,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p108' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=108#p108' #------------------ software_id=64 @@ -1505,7 +1505,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='web interface system management' aSOFTWARE_CATEGORY_INDEX[$software_id]=9 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=80#p3047' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3047#p3047' aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1 #------------------ @@ -1525,7 +1525,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='url website address for your device' aSOFTWARE_CATEGORY_INDEX[$software_id]=10 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p58' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=58#p58' #------------------ software_id=68 @@ -1555,7 +1555,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='gpio interface library for rpi (python)' aSOFTWARE_CATEGORY_INDEX[$software_id]=11 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=40#p1065' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1065#p1065' # - Disable for All non-RPi for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -1594,7 +1594,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=11 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p189' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=189#p189' # - Disable for All non-RPi and RPi3 for ((i=3; i<=$MAX_G_HW_MODEL; i++)) @@ -1646,7 +1646,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=80#p4292' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4292#p4292' #------------------ software_id=123 @@ -1655,7 +1655,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='MQTT messaging broker' aSOFTWARE_CATEGORY_INDEX[$software_id]=11 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=90#p4293' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4293#p4293' #------------------ software_id=131 @@ -1712,7 +1712,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='time-series database' aSOFTWARE_CATEGORY_INDEX[$software_id]=11 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=120#p12523' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12523#p12523' #------------------ software_id=77 @@ -1732,7 +1732,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='prevents brute-force attacks with ip ban' aSOFTWARE_CATEGORY_INDEX[$software_id]=12 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=30#p452' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=452#p452' #------------------ #Webserver stacks @@ -1743,7 +1743,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='apache2 | sqlite | php' aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p52' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' #------------------ software_id=76 @@ -1752,7 +1752,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='apache2 | mariadb | php' aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p52' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' #------------------ software_id=78 @@ -1761,7 +1761,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='nginx | sqlite | php' aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p5' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' #------------------ software_id=79 @@ -1770,7 +1770,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='nginx | mariadb | php' aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p5' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' #------------------ software_id=81 @@ -1788,7 +1788,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='lighttpd | mariadb | php' aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' #------------------ software_id=83 @@ -1798,7 +1798,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p52' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' #------------------ software_id=84 @@ -1818,7 +1818,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p5' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' #------------------ software_id=87 @@ -1857,7 +1857,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p54' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=54#p54' #------------------ software_id=91 @@ -1874,7 +1874,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='free, ssl cert install allowing https://' aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=1061#p1062' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1061#p1062' #------------------ software_id=125 @@ -1898,7 +1898,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p174' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=174#p174' aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 #File servers @@ -1909,7 +1909,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='lightweight ftp server' aSOFTWARE_CATEGORY_INDEX[$software_id]=15 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p55' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=55#p55' #------------------ software_id=95 @@ -1927,7 +1927,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='feature-rich file server' aSOFTWARE_CATEGORY_INDEX[$software_id]=15 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p56' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=56#p56' #------------------ software_id=109 @@ -1936,7 +1936,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='network file system server' aSOFTWARE_CATEGORY_INDEX[$software_id]=15 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p56' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2821#p2821' #------------------ @@ -2011,7 +2011,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=17 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=30#p221' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=221#p221' #Home automation #-------------------------------------------------------------------------------- @@ -2021,7 +2021,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='energy usage addon board with web interface' aSOFTWARE_CATEGORY_INDEX[$software_id]=18 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=1529#p1525' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1525#p1525' # - Disable for All non-RPi for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -2042,7 +2042,7 @@ _EOF_ aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p70' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=70#p70' #------------------ @@ -2358,7 +2358,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='rotates log files' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p68' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' #------------------ software_id=102 @@ -2366,7 +2366,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='system logging' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p68' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' #------------------ software_id=103 @@ -2374,7 +2374,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='minimal, optimized logging' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p68' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' #------------------ #-------------------------------------------------------------------------------- @@ -2386,7 +2386,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='lightweight ssh server' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p62' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=62#p62' #------------------ software_id=105 @@ -2394,7 +2394,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='feature rich ssh server' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p63' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=63#p63' #------------------ #-------------------------------------------------------------------------------- @@ -2899,13 +2899,13 @@ _EOF_ Create_Desktop_Shared_Items(){ # - Pre-create dirs - mkdir -p $HOME/Desktop + mkdir -p /root/Desktop mkdir -p /usr/share/applications mkdir -p /var/lib/dietpi/dietpi-software/installed/desktop/icons mkdir -p /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers # - Copy DietPi favourite links - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/gtk/.gtk-bookmarks -O $HOME/.gtk-bookmarks + G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/gtk/.gtk-bookmarks -O /root/.gtk-bookmarks # - DietPi Apps to download local adesktop_items=( @@ -2952,10 +2952,10 @@ _EOF_ G_THREAD_WAIT # - Desktop app symlinks - ln -sf /usr/share/applications/htop.desktop $HOME/Desktop/htop.desktop - ln -sf /usr/share/applications/dietpi-software.desktop $HOME/Desktop/dietpi-software.desktop - ln -sf /usr/share/applications/dietpi-config.desktop $HOME/Desktop/dietpi-config.desktop - ln -sf /usr/share/applications/dietpi-launcher.desktop $HOME/Desktop/dietpi-launcher.desktop + ln -sf /usr/share/applications/htop.desktop /root/Desktop/htop.desktop + ln -sf /usr/share/applications/dietpi-software.desktop /root/Desktop/dietpi-software.desktop + ln -sf /usr/share/applications/dietpi-config.desktop /root/Desktop/dietpi-config.desktop + ln -sf /usr/share/applications/dietpi-launcher.desktop /root/Desktop/dietpi-launcher.desktop } @@ -3198,13 +3198,13 @@ _EOF_ # #Install Python and PIP # G_AGI python python-pip python-imaging # - # cd $HOME + # cd /root # git clone --depth=1 "$INSTALL_URL_ADDRESS" # # # - Move HTPC Manager to a 'better' location # mkdir -p $G_FP_DIETPI_USERDATA/htpc-manager - # mv $HOME/HTPC-Manager/* $G_FP_DIETPI_USERDATA/htpc-manager/ - # rm -R $HOME/HTPC-Manager + # mv /root/HTPC-Manager/* $G_FP_DIETPI_USERDATA/htpc-manager/ + # rm -R /root/HTPC-Manager # # fi # @@ -3964,7 +3964,7 @@ _EOF_ fi - G_THREAD_START wget https://dietpi.com/downloads/binaries/all/cava.psf -O $HOME/cava.psf # + Font for cava, nice bars + G_THREAD_START wget https://dietpi.com/downloads/binaries/all/cava.psf -O /root/cava.psf # + Font for cava, nice bars DEPS_LIST='libpulse0 libfftw3-3' Download_Install "$INSTALL_URL_ADDRESS" @@ -4404,7 +4404,7 @@ _EOF_ ./build cd /tmp/$G_PROGRAM_NAME - mv wiringPi $HOME/ + mv wiringPi /root/ fi @@ -7094,7 +7094,7 @@ _EOF_ (( ${aSOFTWARE_INSTALL_STATE[101]} == 2 )) && aSOFTWARE_INSTALL_STATE[101]=-1 (( ${aSOFTWARE_INSTALL_STATE[102]} == 2 )) && aSOFTWARE_INSTALL_STATE[102]=-1 - #Ramlog - backup every 1H to $HOME/logfile_storage, then clear. + #Ramlog - backup every 1H to /root/logfile_storage, then clear. elif (( $INDEX_LOGGING_TARGET == -2 )); then aSOFTWARE_INSTALL_STATE[103]=1 @@ -7150,7 +7150,7 @@ _EOF_ # if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then # # # - file manager desktop icon - # ln -sf /usr/share/applications/caja.desktop $HOME/Desktop/caja.desktop + # ln -sf /usr/share/applications/caja.desktop /root/Desktop/caja.desktop # # Create_Desktop_Shared_Items # @@ -7179,19 +7179,19 @@ _EOF_ Banner_Configuration #Pre-create dirs - mkdir -p $HOME/.config/openbox - mkdir -p $HOME/.config/lxpanel/LXDE/panels - mkdir -p $HOME/.config/pcmanfm/LXDE + mkdir -p /root/.config/openbox + mkdir -p /root/.config/lxpanel/LXDE/panels + mkdir -p /root/.config/pcmanfm/LXDE # - PCmanFM configs - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm.conf -O $HOME/.config/pcmanfm/LXDE/pcmanfm.conf - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm-desktopitems.conf -O $HOME/.config/pcmanfm/LXDE/desktop-items-0.conf + G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm.conf -O /root/.config/pcmanfm/LXDE/pcmanfm.conf + G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm-desktopitems.conf -O /root/.config/pcmanfm/LXDE/desktop-items-0.conf # - Panel config - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/panel -O $HOME/.config/lxpanel/LXDE/panels/panel + G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/panel -O /root/.config/lxpanel/LXDE/panels/panel # - Openbox config - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/lxde-rc.xml -O $HOME/.config/openbox/lxde-rc.xml + G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/lxde-rc.xml -O /root/.config/openbox/lxde-rc.xml # - Remove Lxrandr Menu item (monitor configuration tool as we set res in dietpi-config) [[ -f /usr/share/applications/lxrandr.desktop ]] && rm /usr/share/applications/lxrandr.desktop @@ -7211,7 +7211,7 @@ _EOF_ Create_Desktop_Shared_Items # - file manager desktop icon - ln -sf /usr/share/applications/pcmanfm.desktop $HOME/Desktop/pcmanfm.desktop + ln -sf /usr/share/applications/pcmanfm.desktop /root/Desktop/pcmanfm.desktop fi @@ -7224,7 +7224,7 @@ _EOF_ Create_Desktop_Shared_Items # - file manager desktop icon - ln -sf /usr/share/applications/caja.desktop $HOME/Desktop/caja.desktop + ln -sf /usr/share/applications/caja.desktop /root/Desktop/caja.desktop #Odroid C2, define default pulseaudio sink: https://github.com/MichaIng/DietPi/issues/415 if (( $G_HW_MODEL == 12 )); then @@ -8692,7 +8692,7 @@ WantedBy=multi-user.target _EOF_ #Symlink to home dir: https://github.com/MichaIng/DietPi/issues/1256 - ln -sf $G_FP_DIETPI_USERDATA/node-red $HOME/.node-red + ln -sf $G_FP_DIETPI_USERDATA/node-red /root/.node-red fi @@ -8712,10 +8712,10 @@ _EOF_ Banner_Configuration # - Cava conf - mkdir -p $HOME/.config/cava + mkdir -p /root/.config/cava - G_BACKUP_FP $HOME/.config/cava/config - cp /var/lib/dietpi/dietpi-software/conf/cava.conf $HOME/.config/cava/config + G_BACKUP_FP /root/.config/cava/config + cp /var/lib/dietpi/dietpi-software/conf/cava.conf /root/.config/cava/config # - lower MPD buffer size to reduce latency of spectrum: sed -i '/audio_buffer_size /c\audio_buffer_size "384"' /etc/mpd.conf @@ -8807,10 +8807,10 @@ _EOF_ chmod +x /etc/udev/rules.d/99-dietpi-kodi.rules #Create .desktop SymLinks - mkdir -p $HOME/Desktop + mkdir -p /root/Desktop [[ -f /usr/share/applications/kodi.desktop ]] && rm /usr/share/applications/kodi.desktop G_RUN_CMD wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/apps/kodi.desktop -O /usr/share/applications/kodi.desktop - ln -sf /usr/share/applications/kodi.desktop $HOME/Desktop/kodi.desktop + ln -sf /usr/share/applications/kodi.desktop /root/Desktop/kodi.desktop fi @@ -8989,20 +8989,20 @@ _EOF_ #Symlink savegames to root # - Remove existing syslinks - rm -R $HOME/.d1x-rebirth &> /dev/null - rm -R $HOME/.d2x-rebirth &> /dev/null + rm -R /root/.d1x-rebirth &> /dev/null + rm -R /root/.d2x-rebirth &> /dev/null - ln -sf $G_FP_DIETPI_USERDATA/dxx-rebirth/descent_1_profiles $HOME/.d1x-rebirth - ln -sf $G_FP_DIETPI_USERDATA/dxx-rebirth/descent_2_profiles $HOME/.d2x-rebirth + ln -sf $G_FP_DIETPI_USERDATA/dxx-rebirth/descent_1_profiles /root/.d1x-rebirth + ln -sf $G_FP_DIETPI_USERDATA/dxx-rebirth/descent_2_profiles /root/.d2x-rebirth #+exe chmod +x -R $G_FP_DIETPI_USERDATA/dxx-rebirth/* #Create .Desktop SymLinks - mkdir -p $HOME/Desktop + mkdir -p /root/Desktop mkdir -p /usr/share/applications - ln -s $G_FP_DIETPI_USERDATA/dxx-rebirth/dxx-rebirth.desktop $HOME/Desktop/dxx-rebirth.desktop + ln -s $G_FP_DIETPI_USERDATA/dxx-rebirth/dxx-rebirth.desktop /root/Desktop/dxx-rebirth.desktop ln -s $G_FP_DIETPI_USERDATA/dxx-rebirth/dxx-rebirth.desktop /usr/share/applications/dxx-rebirth.desktop fi @@ -9018,10 +9018,10 @@ _EOF_ chmod +x /usr/local/games/opentyrian/run #Create .Desktop SymLinks - mkdir -p $HOME/Desktop + mkdir -p /root/Desktop rm /usr/share/applications/opentyrian.desktop &> /dev/null G_RUN_CMD wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/apps/opentyrian.desktop -O /usr/share/applications/opentyrian.desktop - ln -s /usr/share/applications/opentyrian.desktop $HOME/Desktop/opentyrian.desktop + ln -s /usr/share/applications/opentyrian.desktop /root/Desktop/opentyrian.desktop fi @@ -9682,8 +9682,8 @@ _EOF_ fi - mkdir -p $HOME/.vnc - cat << _EOF_ > $HOME/.vnc/xstartup + mkdir -p /root/.vnc + cat << _EOF_ > /root/.vnc/xstartup #!/bin/bash export SHELL='/bin/bash' [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup @@ -9693,7 +9693,7 @@ vncconfig -iconic & $cmd_launch_desktop _EOF_ - chmod +x $HOME/.vnc/xstartup + chmod +x /root/.vnc/xstartup fi @@ -10912,7 +10912,7 @@ program= _EOF_ #Jessie WebUI\Password_ha1 breaks login with m5dsum generated pw, revert to default 'adminadmin': https://github.com/MichaIng/DietPi/issues/1499#issuecomment-364769146 - (( $G_DISTRO == 3 )) && sed -i '/Password_ha1=/d' $HOME/.config/qBittorrent/qBittorrent.conf + (( $G_DISTRO == 3 )) && sed -i '/Password_ha1=/d' /root/.config/qBittorrent/qBittorrent.conf # - service cat << _EOF_ > /etc/systemd/system/qbittorrent.service @@ -11455,18 +11455,18 @@ $export_options _EOF_ # Chromium 60+ - cp /etc/chromium.d/custom_flags $HOME/.chromium-browser.init + cp /etc/chromium.d/custom_flags /root/.chromium-browser.init #Symlink to desktop # * for RPi Stretch due to chromium-browser.desktop - ln -sf /usr/share/applications/chromium*.desktop $HOME/Desktop/chromium.desktop &> /dev/null + ln -sf /usr/share/applications/chromium*.desktop /root/Desktop/chromium.desktop &> /dev/null # - Autostart run script for Kiosk mode, based on @AYapejian https://github.com/MichaIng/DietPi/issues/1737#issue-318697621 cat << _EOF_ > /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh #!/bin/bash #Autostart run script for Kiosk mode, based on @AYapejian https://github.com/MichaIng/DietPi/issues/1737#issue-318697621 -# - Please see $HOME/.chromium-browser.init (and /etc/chromium.d/custom_flags) for additional egl/gl init options +# - Please see /root/.chromium-browser.init (and /etc/chromium.d/custom_flags) for additional egl/gl init options # Command line switches https://peter.sh/experiments/chromium-command-line-switches/ # --test-type gets rid of some of the chromium warnings that you may or may not care about in kiosk on a LAN @@ -11770,7 +11770,7 @@ _EOF_ # - Install language packs: https://github.com/MichaIng/DietPi/issues/1917#issue-340631943 cd /etc/sabnzbd G_RUN_CMD python tools/make_mo.py - cd $HOME + cd /root fi @@ -12144,10 +12144,10 @@ _EOF_ Banner_Configuration mkdir -p $G_FP_DIETPI_USERDATA/steam - mv $HOME/.steam/* $G_FP_DIETPI_USERDATA/steam/ - rm -R $HOME/.steam + mv /root/.steam/* $G_FP_DIETPI_USERDATA/steam/ + rm -R /root/.steam - ln -sf $G_FP_DIETPI_USERDATA/steam $HOME/.steam + ln -sf $G_FP_DIETPI_USERDATA/steam /root/.steam fi @@ -13003,7 +13003,7 @@ _EOF_ Banner_Uninstalling npm r -g node-red rm /etc/systemd/system/node-red.service - rm $HOME/.node-red + rm /root/.node-red rm -R $G_FP_DIETPI_USERDATA/node-red [[ -f /usr/local/bin/node-red ]] && rm /usr/local/bin/node-red [[ -f /usr/local/bin/node-red-pi ]] && rm /usr/local/bin/node-red-pi @@ -13349,7 +13349,7 @@ _EOF_ Banner_Uninstalling rm -R $G_FP_DIETPI_USERDATA/octoprint rm $(command -v octoprint) - rm -R $HOME/.octoprint + rm -R /root/.octoprint rm /etc/systemd/system/octoprint.service fi @@ -13379,7 +13379,7 @@ _EOF_ Banner_Uninstalling G_AGP steam - rm -R $HOME/.steam + rm -R /root/.steam rm -R $G_FP_DIETPI_USERDATA/steam fi @@ -13389,8 +13389,8 @@ _EOF_ Banner_Uninstalling G_AGP cava - rm "$HOME/.config/cava/config" - rm "$HOME/cava.psf" + rm "/root/.config/cava/config" + rm "/root/cava.psf" fi @@ -13440,7 +13440,7 @@ _EOF_ G_AGP ibsdl1.2debian libsdl-net1.2 rm -R /usr/local/games/opentyrian rm /usr/share/applications/opentyrian.desktop - rm ~/Desktop/opentyrian.desktop + rm /root/Desktop/opentyrian.desktop fi @@ -13675,7 +13675,7 @@ _EOF_ rm /etc/systemd/system/vncserver.service rm /etc/init.d/vncserver rm /usr/local/bin/vncserver - rm -R $HOME/.vnc + rm -R /root/.vnc # + RealVNC services systemctl disable vncserver-x11-serviced.service @@ -14152,9 +14152,9 @@ _EOF_ rm -R $G_FP_DIETPI_USERDATA/dxx-rebirth/descent_2_game #Remove symlinks - rm $HOME/.d1x-rebirth - rm $HOME/.d2x-rebirth - rm $HOME/Desktop/dxx-rebirth.desktop + rm /root/.d1x-rebirth + rm /root/.d2x-rebirth + rm /root/Desktop/dxx-rebirth.desktop rm /usr/share/applications/dxx-rebirth.desktop fi @@ -14168,7 +14168,7 @@ _EOF_ rm /etc/chromium.d/custom_flags rm /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh - rm $HOME/.chromium-browser.init + rm /root/.chromium-browser.init G_AGP $(dpkg --get-selections chromium* | mawk '{print $1}') chromedriver # chromedriver: Jessie only @@ -14366,7 +14366,7 @@ _EOF_ # - config folder rm -R /etc/mysql 2> /dev/null - rm -R ~/.mysql_history 2> /dev/null + rm -R /root/.mysql_history 2> /dev/null # - SQL store rm -R /var/lib/mysql 2> /dev/null @@ -14734,8 +14734,8 @@ _EOF_ [[ -f /usr/local/CHANGELOG.md ]] && /usr/local/CHANGELOG.md [[ -f /usr/local/LICENSE ]] && /usr/local/LICENSE [[ -f /usr/local/share/systemtap/tapset/node.stp ]] && rm /usr/local/share/systemtap/tapset/node.stp - [[ -d $HOME/.npm ]] && rm -R $HOME/.npm - [[ -f $HOME/.config/configstore/update-notifier-npm.json ]] && rm $HOME/.config/configstore/update-notifier-npm.json + [[ -d /root/.npm ]] && rm -R /root/.npm + [[ -f /root/.config/configstore/update-notifier-npm.json ]] && rm /root/.config/configstore/update-notifier-npm.json fi From 70e0a664d5b12954d673cde3f20224547ed8d549 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 18:47:35 +0100 Subject: [PATCH 183/232] v6.22 + DietPi-Pre-patch | Set digest to sha256 explicitly as well, in case defaults change in the future. In case there is any Jessie Beta user (veery highly unlikely and non found on survey page) this needs to be re-applied manually. --- dietpi/pre-patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index b989df3e66..99bf68a7d3 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -68,7 +68,7 @@ echo -e '\e[90m[\e[0m \e[33mWARN\e[0m \e[90m]\e[0m Pre-patch 3 | Storing global DietPi-Software password with enhanced security' grep -qi 'buster' /etc/os-release && pbkdf2='-iter 10000' || pbkdf2='' - openssl enc -e -a -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $GLOBAL_PW || { EXIT_CODE=3; break; } + openssl enc -e -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $GLOBAL_PW || { EXIT_CODE=3; break; } fi #------------------------------------------------------------------------------- From a908c436a0591df6271d66487eba681029f0c063 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 18:49:03 +0100 Subject: [PATCH 184/232] v6.22 + DietPi-Patch | Set global PW digest to sha256 explicitly as well --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 9cb8af41f9..e92336958d 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -881,7 +881,7 @@ _EOF_ # - Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213 local pbkdf2='' (( $G_DISTRO > 4 )) && pbkdf2='-iter 10000' - openssl enc -e -a -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $pw_dietpi_software + openssl enc -e -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $pw_dietpi_software unset pw_dietpi_software From b4317202dbae1d7839b95e4d18f6dc8a0b1fce0d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 18:51:58 +0100 Subject: [PATCH 185/232] v6.22 + DietPi-Software | Set global PW digest to sha256 explicitly as well --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9b87c3ce15..8e89f8f76f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -159,7 +159,7 @@ _EOF_ # - Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213 local pbkdf2='' (( $G_DISTRO > 4 )) && pbkdf2='-iter 10000' - GLOBAL_PW=$(openssl enc -d -a -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) + GLOBAL_PW=$(openssl enc -d -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) # - 1st run automated setup only else From 96bce8c3cd207613a0da64e052c9400c3ce5f0d2 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 18:52:45 +0100 Subject: [PATCH 186/232] v6.22 + DietPi-Set_software | Set global PW digest to sha256 explicitly as well --- dietpi/func/dietpi-set_software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index eab42932f3..b409c056a7 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -647,7 +647,7 @@ It is highly recommended to change this password, ideally, it should be differen # - Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213 local pbkdf2='' (( $G_DISTRO > 4 )) && pbkdf2='-iter 10000' - openssl enc -e -a -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $pw_dietpi_software + openssl enc -e -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $pw_dietpi_software Setpermissions_Main &> /dev/null From 922463c9e1bf239b3811bedd2fc3d0dc7cdfa7d0 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 20:56:36 +0100 Subject: [PATCH 187/232] v6.22 (#2635) RPi | Remove "framebuffer_depth" handling completely which defaults to 16 which works in every known case --- CHANGELOG.txt | 1 + config.txt | 1 - dietpi/func/dietpi-set_hardware | 3 --- dietpi/patch_file | 10 +++------- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 75e3bb0bb0..f5b295d68c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Changes / Improvements / Optimisations: - Security | The DietPi-Software global password is now stored with enhanced security which also resolves a warning on Buster systems: https://github.com/MichaIng/DietPi/issues/2213 - General | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives. This allows us to lower DietPi core package dependencies from "p7zip-full" to "p7zip". - General | CPU temps (if available on the device) now displayed in the login banners. Many thanks to esturniolo for the suggestion: https://twitter.com/esturniolo/status/1104912062298423297 +- RPi | DietPi does not set or change "framebuffer_depth" in config.txt anymore which defaults to 16 which works in every known case. It will be re-added as fast as we find a case where another value is required. - DietPi-NordVPN | Added sent/received usage stats for VPN tunnel. - DietPi-Sync | Sync will now abort if the source dir is empty. Merged dry run into real sync, as this was performed anyway to do required free space check. When "Sync" is selected, after dry run the user is presented a summary and given the option to view the detailed dry run log, cancel or continue with real sync. Some other minor fixes and enhancements have been applied as well. Many thanks to @midnightwatcher for doing this request: https://dietpi.com/phpbb/viewtopic.php?f=12&t=5588 - DietPi-Software | Emby Server: Now installs the latest version automatically (currently 4.0.2) which as well offers a native ARMv8 package: https://github.com/MichaIng/DietPi/pull/2525 diff --git a/config.txt b/config.txt index 5c44670bd3..3da45b4351 100644 --- a/config.txt +++ b/config.txt @@ -22,7 +22,6 @@ # Uncomment to force a console size. By default it will be display's size minus overscan. #framebuffer_width=1280 #framebuffer_height=720 -#framebuffer_depth=16 # SDTV_MODES #sdtv_mode=0 diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 95e5a84ac8..0509ad6e8f 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -223,8 +223,6 @@ systemctl enable dietpi-rm_program_usb_boot_mode G_CONFIG_INJECT 'framebuffer_height=' '#framebuffer_height=0' /DietPi/config.txt G_CONFIG_INJECT 'max_framebuffer_width=' '#max_framebuffer_width=0' /DietPi/config.txt G_CONFIG_INJECT 'max_framebuffer_height=' '#max_framebuffer_height=0' /DietPi/config.txt - # - framebuffer_depth defaults to a set value of 16, even with HDMI disabled, so we manually reduce it to min 8 - G_CONFIG_INJECT 'framebuffer_depth=' 'framebuffer_depth=8' /DietPi/config.txt # - Splash cannot be seen anyway, without video output G_CONFIG_INJECT 'disable_splash=' 'disable_splash=1' /DietPi/config.txt # - hdmi_blanking should not play a role, however mode 1 should be generally preferred, which on idle disables HDMI output completely instead of just blanking the screen @@ -256,7 +254,6 @@ systemctl enable dietpi-rm_program_usb_boot_mode if (( $G_HW_MODEL < 10 )); then - G_CONFIG_INJECT 'framebuffer_depth=' '#framebuffer_depth=16' /DietPi/config.txt G_CONFIG_INJECT 'hdmi_ignore_hotplug=' '#hdmi_ignore_hotplug=0' /DietPi/config.txt G_CONFIG_INJECT 'hdmi_ignore_composite=' '#hdmi_ignore_composite=0' /DietPi/config.txt G_CONFIG_INJECT 'hdmi_blanking=' '#hdmi_blanking=0' /DietPi/config.txt diff --git a/dietpi/patch_file b/dietpi/patch_file index e92336958d..5c7dae140c 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -497,13 +497,6 @@ _EOF_ [[ -d /lib/firmware/allo ]] && rm -R /lib/firmware/allo - fi - #------------------------------------------------------------------------------- - #RPi add FB depth 16: https://github.com/MichaIng/DietPi/issues/1716 - if (( $G_HW_MODEL < 10 )) && ! grep -q 'framebuffer_depth=' /DietPi/config.txt; then - - echo -e "\n#framebuffer_depth=16" >> /DietPi/config.txt - fi #------------------------------------------------------------------------------- #RPi UART: https://github.com/MichaIng/DietPi/issues/1759 @@ -1676,6 +1669,9 @@ _EOF_ fi #------------------------------------------------------------------------------- + #RPi | Remove "framebuffer_depth" handling: https://github.com/MichaIng/DietPi/pull/2635 + (( $G_HW_MODEL < 10 )) && sed -i '/framebuffer_depth/d' /DietPi/config.txt + #------------------------------------------------------------------------------- #Reinstalls # Amiberry 2.25: https://github.com/MichaIng/DietPi/issues/2599 # Deluge: Patch according to installer rework: https://github.com/MichaIng/DietPi/pull/2594 From 585c1668f561dcdbe38dc69a60b6a99c2aed9dcc Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 22:23:47 +0100 Subject: [PATCH 188/232] v6.22 (#2636) + System | /etc/bashrc.d/ now allows ".bash" file ending as well. Merged all contained DietPi scripts into one: /etc/bashrc.d/dietpi.bash --- CHANGELOG.txt | 1 + dietpi/dietpi-login | 12 ++-- dietpi/patch_file | 4 +- rootfs/etc/bashrc.d/dietpi-login.sh | 7 --- .../etc/bashrc.d/dietpi-posix-set-locale.sh | 11 ---- .../etc/bashrc.d/dietpi-ps1_kill_animation.sh | 5 -- .../bashrc.d/dietpi-unsupported_terminal.sh | 36 ----------- rootfs/etc/bashrc.d/dietpi.bash | 63 +++++++++++++++++++ 8 files changed, 71 insertions(+), 68 deletions(-) delete mode 100644 rootfs/etc/bashrc.d/dietpi-login.sh delete mode 100644 rootfs/etc/bashrc.d/dietpi-posix-set-locale.sh delete mode 100644 rootfs/etc/bashrc.d/dietpi-ps1_kill_animation.sh delete mode 100644 rootfs/etc/bashrc.d/dietpi-unsupported_terminal.sh create mode 100644 rootfs/etc/bashrc.d/dietpi.bash diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f5b295d68c..4bd98437ff 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ v6.22 Changes / Improvements / Optimisations: - Security | The DietPi-Software global password is now stored with enhanced security which also resolves a warning on Buster systems: https://github.com/MichaIng/DietPi/issues/2213 +- System | /etc/bashrc.d/ now allows ".bash" file ending as well. Merged all contained DietPi scripts into one: /etc/bashrc.d/dietpi.bash. https://github.com/MichaIng/DietPi/pull/2636 - General | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives. This allows us to lower DietPi core package dependencies from "p7zip-full" to "p7zip". - General | CPU temps (if available on the device) now displayed in the login banners. Many thanks to esturniolo for the suggestion: https://twitter.com/esturniolo/status/1104912062298423297 - RPi | DietPi does not set or change "framebuffer_depth" in config.txt anymore which defaults to 16 which works in every known case. It will be re-added as fast as we find a case where another value is required. diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 104a20eb3f..1030319b6f 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -9,8 +9,8 @@ #//////////////////////////////////// # # Info: - # - filename /DietPi/dietpi/dietpi-login - # - activates on login /etc/bashrc.d/dietpi-login.sh + # - Filename: /DietPi/dietpi/dietpi-login + # - Called in interactive bash shells from: /etc/bashrc.d/dietpi.bash #//////////////////////////////////// # Import DietPi-Globals -------------------------------------------------------------- @@ -37,12 +37,8 @@ # Autoboot Run_AutoStart(){ - # - Do we have a valid screen for autoboot? - local screen_valid=0 - [[ ! $DISPLAY && $(tty) == '/dev/tty1' ]] && screen_valid=1 - - # - Boot to specific program - if (( $screen_valid )); then + # - Boot into specific program if we have a valid screen + if [[ ! $DISPLAY && $(tty) == '/dev/tty1' ]]; then # - Kodi if (( $auto_start_index == 1 )); then diff --git a/dietpi/patch_file b/dietpi/patch_file index 5c7dae140c..0688bfcc96 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1553,8 +1553,10 @@ Also have a look at "Sonarr", another alternative TV show manager, available for #------------------------------------------------------------------------------- #Redo our /etc/bash.bashrc entry, user confirmed 4 entries: https://github.com/MichaIng/DietPi/issues/2529 + #As well allow ".bash" file ending and remove obsolete dietpi-*.sh scripts: https://github.com/MichaIng/DietPi/pull/2636 sed -i '\#for i in /etc/bashrc#d' /etc/bash.bashrc - G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc + G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh /etc/bashrc.d/*.bash; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc + rm -f /etc/bashrc.d/dietpi-*.sh #------------------------------------------------------------------------------- #Mopidy fix: https://github.com/MichaIng/DietPi/issues/2536 getent passwd mopidy &> /dev/null && usermod -a -G dietpi,audio -d $G_FP_DIETPI_USERDATA/mopidy mopidy diff --git a/rootfs/etc/bashrc.d/dietpi-login.sh b/rootfs/etc/bashrc.d/dietpi-login.sh deleted file mode 100644 index 18e76501c1..0000000000 --- a/rootfs/etc/bashrc.d/dietpi-login.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# dietpi-* and G_* functions and variables -. /DietPi/dietpi/func/dietpi-globals - -# login scripts and banner -/DietPi/dietpi/dietpi-login diff --git a/rootfs/etc/bashrc.d/dietpi-posix-set-locale.sh b/rootfs/etc/bashrc.d/dietpi-posix-set-locale.sh deleted file mode 100644 index 3490c140a4..0000000000 --- a/rootfs/etc/bashrc.d/dietpi-posix-set-locale.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# Workaround, if SSH client overrides locale with "POSIX" fallback: https://github.com/MichaIng/DietPi/issues/1540#issuecomment-367066178 -if [[ $(locale) =~ 'POSIX' ]]; then - - CURRENT_LOCALE="$(grep -m1 '^[[:blank:]]*AUTO_SETUP_LOCALE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')" - export LANG="${CURRENT_LOCALE:=en_GB.UTF-8}" - export LC_ALL="$CURRENT_LOCALE" - unset CURRENT_LOCALE - -fi diff --git a/rootfs/etc/bashrc.d/dietpi-ps1_kill_animation.sh b/rootfs/etc/bashrc.d/dietpi-ps1_kill_animation.sh deleted file mode 100644 index 1295ecdef7..0000000000 --- a/rootfs/etc/bashrc.d/dietpi-ps1_kill_animation.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# "G_DIETPI-NOFITY -2 message" starts a process animation. -# If scripts fail to kill the animation, e.g. cancelled by user, terminal bash prompt has to do it as last resort: -PROMPT_COMMAND="[[ -w /tmp/dietpi-process.pid ]] && rm /tmp/dietpi-process.pid && tput cub 9 && tput ed; $PROMPT_COMMAND" diff --git a/rootfs/etc/bashrc.d/dietpi-unsupported_terminal.sh b/rootfs/etc/bashrc.d/dietpi-unsupported_terminal.sh deleted file mode 100644 index c9f4cd85c7..0000000000 --- a/rootfs/etc/bashrc.d/dietpi-unsupported_terminal.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Workaround for SSH client passing an unsupported $TERM string: https://github.com/MichaIng/DietPi/issues/2034 -if [[ $SSH_TTY ]] && ! toe -a | grep -q "^$TERM[[:blank:]]"; then - - TERM_old="$TERM" - ncurses_term='' - - if [[ $TERM =~ 256 ]]; then - - export TERM='xterm-256color' - - else - - export TERM='xterm' - - fi - - G_WHIP_MENU_ARRAY=('0' 'Ignore for now, I will change the SSH clients terminal.') - - if ! dpkg-query -s ncurses-term &> /dev/null; then - - ncurses_term=' or install the "ncurses-term" APT packages, which enables a wider terminal support' - G_WHIP_MENU_ARRAY+=('1' 'Install "ncurses-term" now to enable a wider terminal support.') - G_WHIP_DEFAULT_ITEM=1 - - fi - - G_PROGRAM_NAME='Unsupported SSH client terminal' G_WHIP_MENU "[WARNING] Your SSH client passed an unsupported terminal: TERM=$TERM_old\n -As a workaround we fooled the server by setting: TERM=$TERM. This is not the cleanest solution, since commands might expect colours or formats, that are not supported by the actual terminal.\n -Please change your SSH clients terminal, respectively the passed \$TERM string$ncurses_term." && (( $G_WHIP_RETURNED_VALUE )) && G_AGI ncurses-term - - unset TERM_old - unset ncurses_term - -fi diff --git a/rootfs/etc/bashrc.d/dietpi.bash b/rootfs/etc/bashrc.d/dietpi.bash new file mode 100644 index 0000000000..bfdcb905bb --- /dev/null +++ b/rootfs/etc/bashrc.d/dietpi.bash @@ -0,0 +1,63 @@ +#!/bin/bash +{ + #//////////////////////////////////// + # DietPi bash init script + # + #//////////////////////////////////// + # Created by MichaIng / micha@dietpi.com / dietpi.com + # + #//////////////////////////////////// + # + # Info: + # - Filename: /etc/bashrc.d/dietpi.bash + # - Sourced by all interactive bash shells from: /etc/bash.bashrc + # - Prepares shell for DietPi and runs autostarts on /dev/tty1 + #//////////////////////////////////// + + # - DietPi-Globals: dietpi-* aliases, G_* functions and variables + . /DietPi/dietpi/func/dietpi-globals + + # - "G_DIETPI-NOFITY -2 message" starts a process animation. + # If scripts fail to kill the animation, e.g. cancelled by user, terminal bash prompt has to do it as last resort: + PROMPT_COMMAND="[[ -w /tmp/dietpi-process.pid ]] && rm /tmp/dietpi-process.pid && tput cub 9 && tput ed; $PROMPT_COMMAND" + + # - Workaround if SSH client overrides locale with "POSIX" fallback: https://github.com/MichaIng/DietPi/issues/1540#issuecomment-367066178 + if [[ $(locale) =~ 'POSIX' ]]; then + + current_locale=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_LOCALE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + export LANG=${current_locale:=en_GB.UTF-8} + export LC_ALL=$current_locale + unset current_locale + + fi + + # - Workaround if SSH client sets an unsupported $TERM string: https://github.com/MichaIng/DietPi/issues/2034 + if [[ $SSH_TTY ]] && ! toe -a | grep -q "^$TERM[[:blank:]]"; then + + TERM_old=$TERM + ncurses_term='' + + [[ $TERM =~ 256 ]] && export TERM='xterm-256color' || export TERM='xterm' + + G_WHIP_MENU_ARRAY=('0' 'Ignore for now, I will change the SSH clients terminal.') + + if ! dpkg-query -s ncurses-term &> /dev/null; then + + ncurses_term=' or install the "ncurses-term" APT packages, which enables a wider terminal support' + G_WHIP_MENU_ARRAY+=('1' 'Install "ncurses-term" now to enable a wider terminal support.') + G_WHIP_DEFAULT_ITEM=1 + + fi + + G_PROGRAM_NAME='Unsupported SSH client terminal' G_WHIP_MENU "[WARNING] Your SSH client passed an unsupported terminal: TERM=$TERM_old\n +As a workaround we fooled the server by setting: TERM=$TERM. This is not the cleanest solution, since commands might expect colours or formats, that are not supported by the actual terminal.\n +Please change your SSH clients terminal, respectively the passed \$TERM string$ncurses_term." && (( $G_WHIP_RETURNED_VALUE )) && G_AGI ncurses-term + + unset TERM_old + unset ncurses_term + + fi + + # - DietPi-Login: First run setup, autostarts and login banner + /DietPi/dietpi/dietpi-login +} From a3ad63713445ed122f1ab6bac01948c1a277a5bf Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Mar 2019 01:53:13 +0100 Subject: [PATCH 189/232] v6.22 + DietPi-Software | Chromium: Enable on VM, at least on VirtualBox it works, although 3D acceleration fails due to an external issue with VirtualBox (guest additions, "vboxvideo" module) Linux guest X.org (on Windows host) --- dietpi/dietpi-software | 3 --- 1 file changed, 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 8e89f8f76f..6d9672b16b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -434,9 +434,6 @@ _EOF_ # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 - # - VM - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,20]=0 - #Remote Desktops #-------------------------------------------------------------------------------- software_id=27 From 85baeeccb1388bfbcfa935cdbdc1425f6e91e17d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Mar 2019 21:33:40 +0100 Subject: [PATCH 190/232] v6.22 + DietPi-Software | GMediaRender: systemd service "!" exec prefix is not yet supported in Stretch, revert to "+" --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6d9672b16b..c50233fdeb 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12418,8 +12418,8 @@ After=network.target dietpi-boot.service [Service] User=gmrender Group=dietpi -ExecStartPre=!$(command -v touch) /var/log/gmrender.log -ExecStartPre=!$(command -v chown) gmrender:dietpi /var/log/gmrender.log +ExecStartPre=+$(command -v touch) /var/log/gmrender.log +ExecStartPre=+$(command -v chown) gmrender:dietpi /var/log/gmrender.log ExecStart=/bin/dash -c 'gmediarender -u "$(sed -n 5p /DietPi/dietpi/.hw_model)" -f "$( Date: Thu, 14 Mar 2019 01:01:47 +0100 Subject: [PATCH 191/232] META | DietPi-Survey_report: Minor wording and code cleanup --- .meta/dietpi-survey_report | 203 ++++++++++--------------------------- 1 file changed, 51 insertions(+), 152 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 8975a9a773..52a1862581 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -266,9 +266,9 @@ aSOFTWARE_NAME[106]='Lidarr' aSOFTWARE_NAME[107]='rTorrent' aSOFTWARE_NAME[108]='AmiBerry' - aSOFTWARE_NAME[109]='NFS' + aSOFTWARE_NAME[109]='NFS Server' aSOFTWARE_NAME[110]='NFS Client' - aSOFTWARE_NAME[111]='UrBackup server' + aSOFTWARE_NAME[111]='UrBackup Server' aSOFTWARE_NAME[112]='DXX-Rebirth' aSOFTWARE_NAME[113]='Chromium' aSOFTWARE_NAME[114]='Nextcloud' @@ -320,7 +320,7 @@ aSOFTWARE_NAME[160]='Allo_update' aSOFTWARE_NAME[161]='FuguHub' aSOFTWARE_NAME[162]='Docker' - aSOFTWARE_NAME[163]='Gmediarender' + aSOFTWARE_NAME[163]='GMediaRender' aSOFTWARE_NAME[164]='Nukkit' aSOFTWARE_NAME[165]='Gitea' aSOFTWARE_NAME[166]='PI-SPC' @@ -406,7 +406,7 @@ fi - # v6.10+: files can be sourced: + # Source survey files if grep -q '^#!/bin/bash' $file; then . $file @@ -474,8 +474,6 @@ fi - continue - fi done @@ -765,7 +763,7 @@

DietPi versions:

- $(for i in "${!aDIETPI_VERSION[@]}"; do echo ""; done | sort -nrk 1.17,1.20 -t ' ') + $(for i in "${!aDIETPI_VERSION[@]}"; do echo ""; done | sort -nrk 1.17,1.20 -t ' ')
DietPi v${i//6.9/6.09} ${aDIETPI_VERSION[$i]}
DietPi v$i ${aDIETPI_VERSION[$i]}

Git branches:

@@ -800,7 +798,7 @@

DietPi-Automation:

- +
Used by${aAUTO_SETUP_AUTOMATED[1]} of $((${aAUTO_SETUP_AUTOMATED[1]} + ${aAUTO_SETUP_AUTOMATED[0]})) users
Used by${aAUTO_SETUP_AUTOMATED[1]} of $((${aAUTO_SETUP_AUTOMATED[1]} + ${aAUTO_SETUP_AUTOMATED[0]})) installs

Network interfaces:

@@ -813,172 +811,73 @@ $(for i in "${!aSOFTWARE[@]}"; do echo "$i ${aSOFTWARE[$i]}"; done | sort -nrk 2 -t ' ') -

DietPi-Benchmarks | CPU:

- - - - - - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + + $(for i in "${!aBENCH_COMMON_INDEX[@]}"; do echo ""; done | sort -nk 1 -t ' ')
- - - CPU time (seconds, lower is faster): - - CPU idle temp ('c): - - CPU full load temp ('c): - + CPU time (seconds, lower is faster):CPU idle temp ('c):CPU full load temp ('c):
- Device: - - Total benchmarks: - - Average: - - Fastest: - - Slowest: - - Average: - - Lowest: - - Highest: - - Average: - - Lowest: - - Highest: - Device:Total benchmarks:Average:Fastest:Slowest:Average:Lowest:Highest:Average:Lowest:Highest:
${aHW_NAME[$i]:=$i} ${aBENCH_COMMON_INDEX[$i]} ${aBENCH_RESULT_CPU_AVG[$i]} ${aBENCH_RESULT_CPU_MIN[$i]} ${aBENCH_RESULT_CPU_MAX[$i]} ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]} ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]}

DietPi-Benchmarks | IO (Filesystem & RAM):

- - - - - - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + $(for i in "${!aBENCH_COMMON_INDEX[@]}"; do echo ""; done | sort -nk 1 -t ' ')
- - - RootFS write (MB/s): - - RootFS read (MB/s): - - RAM write (MB/s): - - RAM read (MB/s): - + RootFS write (MB/s):RootFS read (MB/s):RAM write (MB/s):RAM read (MB/s):
- Device: - - Total benchmarks: - - Average: - - Fastest: - - Slowest: - - Average: - - Fastest: - - Slowest: - - Average: - - Fastest: - - Slowest: - - Average: - - Fastest: - - Slowest: - Device:Total benchmarks:Average:Fastest:Slowest:Average:Fastest:Slowest:Average:Fastest:Slowest:Average:Fastest:Slowest:
${aHW_NAME[$i]:=$i} ${aBENCH_COMMON_INDEX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]} ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]} ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} ${aBENCH_RESULT_RAM_READ_AVG[$i]} ${aBENCH_RESULT_RAM_READ_MAX[$i]} ${aBENCH_RESULT_RAM_READ_MIN[$i]}
-

DietPi-Benchmarks | Network LAN throughput:

+

DietPi-Benchmarks | Network LAN throughput:

- - - - - - - + + - - - - - - + + + + + $(for i in "${!aBENCH_LAN_INDEX[@]}"; do echo ""; done | sort -nk 1 -t ' ')
- - - Transfer rate (MB/s): - + Transfer rate (MB/s):
- Device: - - Total benchmarks: - - Average: - - Fastest: - - Slowest: - Device:Total benchmarks:Average:Fastest:Slowest:
${aHW_NAME[$i]:=$i} ${aBENCH_LAN_INDEX[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]}
- _EOF_ From 6a923c761e2fc8fab1aa7bde6e9c761db0a83899 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 14 Mar 2019 04:14:01 +0100 Subject: [PATCH 192/232] v6.22 + DietPi-RAMlog | Minor coding and wording align with DietPi-RAMdisk --- dietpi/func/dietpi-ramlog | 68 +++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/dietpi/func/dietpi-ramlog b/dietpi/func/dietpi-ramlog index 7212380b29..40244cd7af 100644 --- a/dietpi/func/dietpi-ramlog +++ b/dietpi/func/dietpi-ramlog @@ -9,49 +9,50 @@ #//////////////////////////////////// # # Info: - # - Saves /var/log/* atrributes and ownerships during shutdown to $FP_DIETPI_RAMLOG_SAVE - # - Restores /var/log/* atrributes and ownerships during boot from $FP_DIETPI_RAMLOG_SAVE - # - Uses cp with preserve ownership and attributes only. This generates blank file if required (ramlog) without override existing file data (non-ramlog). + # - /var/log is mounted as tmpfs (RAMdisk) before this script runs. + # - Saves /var/log/* attributes and ownerships to $FP_STORE during shutdown + # - Restores /var/log/* atrributes and ownerships from $FP_STORE during boot + # - This allows us to vastly reduce filesystem I/O and increase logging performance # # Usage: - # - /DietPi/dietpi/func/dietpi-ramlog 0 = Startup Phase (restores /var/log) - # - /DietPi/dietpi/func/dietpi-ramlog 1 = Shutdown Phase (saves /var/log) + # - /DietPi/dietpi/func/dietpi-ramlog 0 = Restore from $FP_STORE to /var/log + # - /DietPi/dietpi/func/dietpi-ramlog 1 = Store from /var/log to $FP_STORE #//////////////////////////////////// #------------------------------------------------------------------------------------- - #. /DietPi/dietpi/func/dietpi-globals # Not compatible until dietpi-preboot.service and overkill for the purpose of this script. - #export LC_ALL=en_GB.UTF-8 # Not needed, as we do not parse any external command and "date" is allowed to be in user locale format. - #cd $HOME # "cd: HOME not set" error and not needed, since we do not create any tmp files. + #. /DietPi/dietpi/func/dietpi-globals # Not compatible until DietPi-PreBoot has finished and overkill for the purpose of this script. + #export LC_ALL=en_GB.UTF-8 # Not required, as we do not parse any external command and "date" is allowed to be in user locale format. + #cd $HOME # Not required, as we do not create any tmp files and produces and: "cd: HOME not set" #------------------------------------------------------------------------------------- - INPUT=-1 # Use no valid default to prevent accidental removal of storage or recovery of intentionally removed files. - [[ $1 =~ ^-?[0-9]+$ ]] && INPUT=$1 + [[ $1 =~ ^-?[0-9]+$ ]] && INPUT=$1 || INPUT=-1 EXIT_CODE=0 PROGRAM_NAME='DietPi-RAMlog' - FP_DIETPI_RAMLOG_SAVE='/var/tmp/dietpi/logs/dietpi-ramlog_store' + FP_STORE='/var/tmp/dietpi/logs/dietpi-ramlog_store' #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - # Startup Phase (restore /var/log directory structure and files) + # Startup phase: Restore from disk if (( $INPUT == 0 )); then - echo "$(date) | $PROGRAM_NAME: Startup - Restoring log folder structure to RAMdisk..." + echo "$(date) | $PROGRAM_NAME: Restoring logs from disk..." - if [[ -d $FP_DIETPI_RAMLOG_SAVE ]]; then + if [[ -d $FP_STORE ]]; then - # - Apply previous attributes and ownerships. Generates empty file if it doesnt exist. - cp -Rp --attributes-only $FP_DIETPI_RAMLOG_SAVE/. /var/log/ - EXIT_CODE=$?; if (( $EXIT_CODE )); then + # - Restore empty logs with ownership and permissions from disk + cp -an --attributes-only $FP_STORE/. /var/log/ || EXIT_CODE=$? - echo "$(date) | $PROGRAM_NAME: Startup failed with exit code $EXIT_CODE" + if (( $EXIT_CODE )); then + + echo "$(date) | $PROGRAM_NAME: [ERROR] Restoring logs from disk failed with exit code: $EXIT_CODE" else - echo "$(date) | $PROGRAM_NAME: Startup completed" + echo "$(date) | $PROGRAM_NAME: Restored logs from disk." fi @@ -61,39 +62,30 @@ fi - # Shutdown Phase (saves /var/log directory structure and filenames) + # Shutdown phase: Store to disk elif (( $INPUT == 1 )); then - echo "$(date) | $PROGRAM_NAME: Shutdown - Saving log folder structure to disk..." - - # - Clear previous storage data - if [[ -d $FP_DIETPI_RAMLOG_SAVE ]]; then - - rm -Rf $FP_DIETPI_RAMLOG_SAVE/{,.??,.[^.]}* + echo "$(date) | $PROGRAM_NAME: Storing logs to disk..." - # - Create dir - else - - mkdir -p $FP_DIETPI_RAMLOG_SAVE + # - Assure empty $FP_STORE + [[ -d $FP_STORE ]] && rm -Rf $FP_STORE/{,.??,.[^.]}* || mkdir -p $FP_STORE || EXIT_CODE=$? - fi + # - Store empty logs with ownership and permissions to disk + cp -af --attributes-only /var/log/. $FP_STORE/ || EXIT_CODE=$? - # - Copy logfile attributes and ownership to storage (not file contents) - cp -Rp --attributes-only /var/log/. $FP_DIETPI_RAMLOG_SAVE/ - EXIT_CODE=$?; if (( $EXIT_CODE )); then + if (( $EXIT_CODE )); then - echo "$(date) | $PROGRAM_NAME: Shutdown failed with exit code $EXIT_CODE" + echo "$(date) | $PROGRAM_NAME: [ERROR] Storing logs to disk failed with exit code: $EXIT_CODE" else - echo "$(date) | $PROGRAM_NAME: Shutdown completed" + echo "$(date) | $PROGRAM_NAME: Stored logs to disk." fi - # Unknown argument else - echo "$(date) | $PROGRAM_NAME: Unknown argument: $INPUT. Aborting..." + echo "$(date) | $PROGRAM_NAME: [ERROR] Unknown argument: $INPUT. Aborting..." EXIT_CODE=1 fi From 31f4900b576deead5801b820aa99e72ef2a3eb8d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Mar 2019 14:47:15 +0100 Subject: [PATCH 193/232] v6.22 + DietPi-Patch | Tiny fix for Beta users on Jessie system to switch global PW to sha256 digest --- dietpi/patch_file | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 0688bfcc96..40998b7cdd 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1674,6 +1674,15 @@ _EOF_ #RPi | Remove "framebuffer_depth" handling: https://github.com/MichaIng/DietPi/pull/2635 (( $G_HW_MODEL < 10 )) && sed -i '/framebuffer_depth/d' /DietPi/config.txt #------------------------------------------------------------------------------- + #Tiny fix for Beta users on Jessie system to switch global PW to sha256 digest, since related pre-patch is not re-run on RC-only updates: https://github.com/MichaIng/DietPi/commit/70e0a664d5b12954d673cde3f20224547ed8d549 + local global_pw='' + if (( $G_DISTRO < 4 )) && + global_pw=$(openssl enc -d -a -md md5 -aes-256-cbc -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin 2> /dev/null); then + + openssl enc -e -a -md sha256 -aes-256-cbc -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $global_pw + + fi + #------------------------------------------------------------------------------- #Reinstalls # Amiberry 2.25: https://github.com/MichaIng/DietPi/issues/2599 # Deluge: Patch according to installer rework: https://github.com/MichaIng/DietPi/pull/2594 From 9b4cd690b25103a5f0635b7a522e70ef2e45c6d0 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Mar 2019 22:14:54 +0100 Subject: [PATCH 194/232] v6.22 (#2554) + DietPi-Software | Plex Media Server: Now installs the latest version automatically (currently 1.15) which as well includes official ARM binaries. + DietPi-Software/Process_tool | Minor coding --- CHANGELOG.txt | 1 + dietpi/dietpi-process_tool | 26 +++++++------- dietpi/dietpi-software | 71 +++++++++++++------------------------- 3 files changed, 39 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4bd98437ff..f8296e5c7f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -22,6 +22,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Netdata: On Debian Stretch/Buster and Raspbian Buster an up-to-date APT package is available, which will now be installed instead of our custom build. Many thanks to @74cmonty for this information: https://github.com/MichaIng/DietPi/issues/2446 - DietPi-Software | DietPi-RAMlog: When installing/enabling RAMlog, the /var/log mountpoint will be now cleaned before mounting the tmpfs on it, while preserving the existing logs metadata. This resolves a warning on early boot stage and frees the disk space consumed by the disk log before. - DietPi-Software | rTorrent: Runs now as user "rtorrent" and creates files as group "dietpi" with 775/664 permissions. Enabled Buster support and enhanced config file handling on reinstall: https://github.com/MichaIng/DietPi/pull/2633 +- DietPi-Software | Plex Media Server: Now installs the latest version automatically (currently 1.15) which as well includes official ARM binaries. Many thanks to @WolfganP for informing us about this new release: https://github.com/MichaIng/DietPi/issues/2553 Bug Fixes: - System | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2529 diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index 2e373b679c..d49012ad0a 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -19,14 +19,13 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - G_CHECK_ROOT_USER G_PROGRAM_NAME='DietPi-Process_tool' + G_CHECK_ROOT_USER G_INIT #Import DietPi-Globals --------------------------------------------------------------- #Grab Input - INPUT=0 - disable_error=1 G_CHECK_VALIDINT $1 && INPUT=$1 + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 #///////////////////////////////////////////////////////////////////////////////////// # Globals @@ -171,6 +170,9 @@ done <<< "$(pgrep -f "${aPROCESS_NAME[$i]}")" + # PMS v1.15: Renice com.plexapp.system sub process to 15 which it spawns at + [[ ${aNAME[$i]} == 'Plex Media Server' ]] && renice -n 15 -p $(pgrep -f 'com.plexapp.system') &> /dev/null + fi done @@ -306,8 +308,8 @@ while read line do - aNAME[$index]="$(sed 's/:.*$//' <<< $line)" - aPROCESS_NAME[$index]="$(sed 's/^.*://' <<< $line)" + aNAME[$index]=$(sed 's/:.*$//' <<< $line) + aPROCESS_NAME[$index]=$(sed 's/^.*://' <<< $line) ((index++)) done < $fp_include @@ -358,10 +360,10 @@ do # - available schedulers - aSCHEDULE_AVAILABLE_POLICY[$index]="${line%%[[:blank:]]*}" + aSCHEDULE_AVAILABLE_POLICY[$index]=${line%%[[:blank:]]*} # - available priorities - line="${line##*: }" + line=${line##*: } # -- min aSCHEDULE_AVAILABLE_PRIORITY_MIN[$index]=${line%/*} # -- max @@ -500,7 +502,7 @@ _EOF_ done - G_WHIP_DEFAULT_ITEM="$LAST_SELECTED_NAME" + G_WHIP_DEFAULT_ITEM=$LAST_SELECTED_NAME G_WHIP_BUTTON_CANCEL_TEXT='Exit' if G_WHIP_MENU 'Please select a program:'; then @@ -591,7 +593,7 @@ _EOF_ done - G_WHIP_DEFAULT_ITEM="$nice_current" + G_WHIP_DEFAULT_ITEM=$nice_current G_WHIP_MENU "Please select your nice level for:\n${aNAME[$index_current]}\n\nInfo:\n - Negative values have a higher priority (eg: -10).\n - Positive values have a lower priority (eg: 15).\n - The default value is 0." if (( ! $? )); then @@ -644,7 +646,7 @@ _EOF_ done #Update affinity array with new value, if at least 1 item was selected. - [[ $new_affinity ]] && aAFFINITY[$index_current]="$new_affinity" + [[ $new_affinity ]] && aAFFINITY[$index_current]=$new_affinity #Apply Apply_Process_Tool @@ -687,7 +689,7 @@ _EOF_ done - G_WHIP_DEFAULT_ITEM="${aSCHEDULE_POLICY[$index_current]}" + G_WHIP_DEFAULT_ITEM=${aSCHEDULE_POLICY[$index_current]} if G_WHIP_MENU "Please select a Schedule Policy for :\n${aNAME[$index_current]}"; then aSCHEDULE_POLICY[$index_current]=$G_WHIP_RETURNED_VALUE @@ -771,7 +773,7 @@ _EOF_ done - G_WHIP_DEFAULT_ITEM="${aSCHEDULE_PRIORITY[$index_current]}" + G_WHIP_DEFAULT_ITEM=${aSCHEDULE_PRIORITY[$index_current]} G_WHIP_MENU "Please select a Schedule Priority level for :\n${aNAME[$index_current]}\n\n - Lower values are low priority\n - Higher values are high priority" if (( ! $? )); then diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c50233fdeb..0a47c4b6c3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5246,46 +5246,33 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #PLEXMEDIASERVER - software_id=42 + software_id=42 # Plex Media Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #x86_64 - if (( $G_HW_ARCH == 10 )); then - - Download_Install 'https://downloads.plex.tv/plex-media-server/1.14.0.5470-9d51fdfaa/plexmediaserver_1.14.0.5470-9d51fdfaa_amd64.deb' - - #ARM - else - - INSTALL_URL_ADDRESS='https://dev2day.de/pms/' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - - echo "deb [arch=armhf] $INSTALL_URL_ADDRESS $G_DISTRO_NAME main" > /etc/apt/sources.list.d/plex.list - wget -O - "$INSTALL_URL_ADDRESS"dev2day-pms.gpg.key | apt-key add - - - # Buster: Revert repo to Stretch, as Buster is not yet available - sed -i 's/buster/stretch/g' /etc/apt/sources.list.d/plex.list + # Derive latest version from: https://plex.tv/pms/downloads/5 + INSTALL_URL_ADDRESS='https://plex.tv/pms/downloads/5' + G_CHECK_URL "$INSTALL_URL_ADDRESS" - #ARMv8: Install 32bit binaries - if (( $G_HW_ARCH == 3 )); then + # ARMv7 + local arch='armhf' - dpkg --add-architecture armhf - G_AGUP - G_AGI libstdc++6:armhf plexmediaserver-installer:armhf + # ARMv8 + if (( $G_HW_ARCH == 3 )); then - #ARM32 - else + arch='arm64' - G_AGUP - G_AGI plexmediaserver-installer + # x86_64 + elif (( $G_HW_ARCH == 10 )); then - fi + arch='amd64' fi + # Derive URL from arch + no_check_url=1 Download_Install "$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "distro=\"debian\".*$arch\.deb" | cut -d \" -f 8)" + fi #CUBERITE @@ -5537,7 +5524,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - no_check_url=1 Download_Install "$(curl -s $INSTALL_URL_ADDRESS | grep -m1 "browser_download_url.*linux-$arch-v[0-9.]*tar\.gz" | cut -d \" -f 4)" /etc + no_check_url=1 Download_Install "$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*linux-$arch-v[0-9.]*tar\.gz" | cut -d \" -f 4)" /etc mv /etc/syncthing-* /etc/syncthing fi @@ -5834,7 +5821,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior INSTALL_URL_ADDRESS='https://api.github.com/repos/Radarr/Radarr/releases' G_CHECK_URL "$INSTALL_URL_ADDRESS" #full filepath below, returns --spider error :( - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux.tar.gz' | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux\.tar\.gz' | cut -d \" -f 4) DEPS_LIST='mediainfo' no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt @@ -5849,7 +5836,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior INSTALL_URL_ADDRESS='https://api.github.com/repos/Lidarr/Lidarr/releases' G_CHECK_URL "$INSTALL_URL_ADDRESS" - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux.tar.gz' | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux\.tar\.gz' | cut -d \" -f 4) DEPS_LIST='mediainfo' no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt @@ -5890,7 +5877,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior INSTALL_URL_ADDRESS='https://api.github.com/repos/Jackett/Jackett/releases/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" #full filepath below, returns --spider error :( - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*Jackett.Binaries.Mono.tar.gz' | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*Jackett\.Binaries\.Mono\.tar\.gz' | cut -d \" -f 4) no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt @@ -10675,22 +10662,12 @@ location = /.well-known/caldav { fi - #PLEXMEDIASERVER - software_id=42 + software_id=42 # Plex Media Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration Download_Test_Media - # For all ARM devices: - # - en_US.UTF-8 must be installed and the default locale on system. This is for SBC installs using dev2day repo: https://github.com/MichaIng/DietPi/issues/116#issuecomment-222195911 - if (( $G_HW_ARCH < 10 )) && ! locale | grep -q 'en_US.UTF-8'; then - - G_WHIP_MSG 'Plex Media Server requires en_US.UTF-8 locale to be installed and set to default, else, Plex will not start.\n\nThe installer will now change your locale to: en_US.UTF-8' - /DietPi/dietpi/func/dietpi-set_software locale 'en_US.UTF-8' - - fi - # Run service as "dietpi" group: https://github.com/MichaIng/DietPi/issues/350#issuecomment-423763518 mkdir -p /etc/systemd/system/plexmediaserver.service.d echo -e '[Service]\nGroup=dietpi' > /etc/systemd/system/plexmediaserver.service.d/dietpi-group.conf @@ -14008,14 +13985,14 @@ _EOF_ fi - software_id=42 + software_id=42 # Plex Media Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP $(dpkg --get-selections plexmediaserver* | mawk '{print $1}') - [[ -d /var/lib/plexmediaserver ]] && rm -R /var/lib/plexmediaserver - [[ -f etc/apt/sources.list.d/plex.list ]] && rm /etc/apt/sources.list.d/plex.list && G_AGUP [[ -d /etc/systemd/system/plexmediaserver.service.d ]] && rm -R /etc/systemd/system/plexmediaserver.service.d # post v6.17 + [[ -d /var/lib/plexmediaserver ]] && rm -R /var/lib/plexmediaserver # pre v6.22 Plex v1.15 + [[ -f etc/apt/sources.list.d/plex.list ]] && rm /etc/apt/sources.list.d/plex.list && G_AGUP # pre v6.22 fi @@ -14023,7 +14000,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - rm -R /etc/cuberite &> /dev/null #v6.11< + rm -R /etc/cuberite &> /dev/null # pre v6.11 rm -R $G_FP_DIETPI_USERDATA/cubrite rm /etc/systemd/system/cuberite.service From ebaa4b06af61bf253dca760735821e18f23d9c1f Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Mar 2019 02:22:56 +0100 Subject: [PATCH 195/232] v6.22 (#2639) + DietPi-Software | Nextcloud: Add OCM/OCS provider redirects as this is checked and printed as warning on admin panel and further update Nginx config according to latest changes in official docs + DietPi-Software | ownCloud/Nextcloud: Workaround Redis socket permission issue on Buster. Requires more secure solution until official Buster release/support. + DietPi-Software | Nextcloud Talk: Handle new coTURN systemd unit and missing config file on Buster + DietPi-Software | Nginx: Do not add non-existent 40x/50x pages, revert to default --- .conf/dps_114/apache.nextcloud.conf | 4 ++ .conf/dps_114/lighttpd.nextcloud.conf | 6 ++ .conf/dps_114/nginx.nextcloud.conf | 21 ++++--- .conf/dps_85/nginx.default | 6 -- CHANGELOG.txt | 1 + dietpi/dietpi-software | 91 ++++++++++++++++++++------- dietpi/patch_file | 26 ++++++++ 7 files changed, 118 insertions(+), 37 deletions(-) diff --git a/.conf/dps_114/apache.nextcloud.conf b/.conf/dps_114/apache.nextcloud.conf index 55994d9fef..6d6e8e33fe 100644 --- a/.conf/dps_114/apache.nextcloud.conf +++ b/.conf/dps_114/apache.nextcloud.conf @@ -1,5 +1,9 @@ # Based on: https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#apache-web-server-configuration +# Redirect OCM/OCS provider requests to Nextcloud endpoint: +Redirect permanent /ocm-provider /nextcloud/ocm-provider +Redirect permanent /ocs-provider /nextcloud/ocs-provider + Options +FollowSymlinks AllowOverride All diff --git a/.conf/dps_114/lighttpd.nextcloud.conf b/.conf/dps_114/lighttpd.nextcloud.conf index f61d733670..489d1862a5 100644 --- a/.conf/dps_114/lighttpd.nextcloud.conf +++ b/.conf/dps_114/lighttpd.nextcloud.conf @@ -2,6 +2,12 @@ # - Apache: https://github.com/nextcloud/server/blob/master/.htaccess # - Nginx: https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html +# Redirect OCM/OCS provider requests to Nextcloud endpoint: +url.redirect += ( + "^/ocm-provider" => "/nextcloud/ocm-provider", + "^/ocs-provider" => "/nextcloud/ocs-provider" +) + $HTTP["url"] =~ "^/nextcloud($|/)" { # Hardening diff --git a/.conf/dps_114/nginx.nextcloud.conf b/.conf/dps_114/nginx.nextcloud.conf index fefb601b29..057e9f4742 100644 --- a/.conf/dps_114/nginx.nextcloud.conf +++ b/.conf/dps_114/nginx.nextcloud.conf @@ -1,4 +1,9 @@ -# Based on: https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html +# Based on: https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html#nextcloud-in-a-subdir-of-nginx + +# Redirect OCM/OCS provider requests to Nextcloud endpoint: +location ~ ^\/(?:ocm-provider|ocs-provider).* { + rewrite ^ /nextcloud$request_uri; +} location ^~ /nextcloud { @@ -34,15 +39,15 @@ location ^~ /nextcloud { rewrite ^ /nextcloud/index.php$request_uri; } - location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)/ { + location ~ ^\/nextcloud\/(?:build|tests|config|lib|3rdparty|templates|data)\/ { deny all; } - location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console) { + location ~ ^\/nextcloud\/(?:\.|autotest|occ|issue|indie|db_|console) { deny all; } - location ~ ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; + location ~ ^\/nextcloud\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|ocm-provider\/.+)\.php(?:$|\/) { + fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; @@ -59,14 +64,14 @@ location ^~ /nextcloud { fastcgi_param PHP_ADMIN_VALUE "opcache.memory_consumption=128"; } - location ~ ^/nextcloud/(?:updater|ocs-provider)(?:$|/) { + location ~ ^\/nextcloud\/(?:updater|ocs-provider|ocm-provider)(?:$|\/) { try_files $uri/ =404; index index.php; } # Adding the cache control header for js and css files # Make sure it is BELOW the PHP block - location ~ \.(?:css|js|woff|svg|gif)$ { + location ~ ^\/nextcloud\/.+[^\/]\.(?:css|js|woff2?|svg|gif)$ { try_files $uri /nextcloud/index.php$request_uri; add_header Cache-Control "public, max-age=15778463"; # Add headers to serve security related headers (It is intended @@ -83,7 +88,7 @@ location ^~ /nextcloud { access_log off; } - location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ { + location ~ ^\/nextcloud\/.+[^\/]\.(?:png|html|ttf|ico|jpg|jpeg)$ { try_files $uri /nextcloud/index.php$request_uri; # Optional: Don't log access to other assets access_log off; diff --git a/.conf/dps_85/nginx.default b/.conf/dps_85/nginx.default index f422382e51..eb57a2b192 100644 --- a/.conf/dps_85/nginx.default +++ b/.conf/dps_85/nginx.default @@ -14,12 +14,6 @@ server { try_files $uri $uri/ =404; } - error_page 404 /404.html; - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /var/www; - } - location ~ \.php(?:$|/) { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f8296e5c7f..8352500203 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -23,6 +23,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | DietPi-RAMlog: When installing/enabling RAMlog, the /var/log mountpoint will be now cleaned before mounting the tmpfs on it, while preserving the existing logs metadata. This resolves a warning on early boot stage and frees the disk space consumed by the disk log before. - DietPi-Software | rTorrent: Runs now as user "rtorrent" and creates files as group "dietpi" with 775/664 permissions. Enabled Buster support and enhanced config file handling on reinstall: https://github.com/MichaIng/DietPi/pull/2633 - DietPi-Software | Plex Media Server: Now installs the latest version automatically (currently 1.15) which as well includes official ARM binaries. Many thanks to @WolfganP for informing us about this new release: https://github.com/MichaIng/DietPi/issues/2553 +- DietPi-Software | Nextcloud: Resolved an admin panel warning about missing ocm/ocs-provider redirects. Many thanks to @minnux for reporting this issue: https://github.com/MichaIng/DietPi/issues/2638 Bug Fixes: - System | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2529 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 0a47c4b6c3..da3faaded0 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7747,7 +7747,7 @@ Redirect permanent /.well-known/caldav /owncloud/remote.php/dav' > /etc/apache2/ if [[ ! -f /etc/lighttpd/conf-enabled/99-dietpi-dav_redirect.conf ]]; then echo '# Redirect Cal/CardDAV requests to ownCloud endpoint: -url.redirect = ( +url.redirect += ( "^/.well-known/caldav" => "/owncloud/remote.php/dav", "^/.well-known/carddav" => "/owncloud/remote.php/dav" )' > /etc/lighttpd/conf-available/99-dietpi-dav_redirect.conf @@ -7915,7 +7915,18 @@ _EOF_ # - Enable Redis socket and grant www-data access to it: # - NB: To allow wildcard expansion, do not use quotes around $redis_conf! GCI_PRESERVE=1 G_CONFIG_INJECT 'unixsocket[[:blank:]]' 'unixsocket /var/run/redis/redis-server.sock' $redis_conf - G_CONFIG_INJECT 'unixsocketperm[[:blank:]]' 'unixsocketperm 770' $redis_conf + # - Current Buster PHP7.3 Redis module cannot access Redis socket even with group + 770 permissions. + # - Obviously group of spawned processes is overridden by only www-data while redis membership is lost. + # - Requires secure solution, however for now we workaround with 777 socket permissions. + if (( $G_DISTRO > 4 )); then + + G_CONFIG_INJECT 'unixsocketperm[[:blank:]]' 'unixsocketperm 777' $redis_conf + + else + + G_CONFIG_INJECT 'unixsocketperm[[:blank:]]' 'unixsocketperm 770' $redis_conf + + fi local redis_sock=$(grep -m1 '^[[:blank:]]*unixsocket[[:blank:]]' $redis_conf | mawk '{print $2}') usermod -a -G redis www-data G_RUN_CMD systemctl restart redis-server @@ -8009,7 +8020,7 @@ Redirect permanent /.well-known/caldav /nextcloud/remote.php/dav' > /etc/apache2 if [[ ! -f /etc/lighttpd/conf-enabled/99-dietpi-dav_redirect.conf ]]; then echo '# Redirect Cal/CardDAV requests to Nextcloud endpoint: -url.redirect = ( +url.redirect += ( "^/.well-known/caldav" => "/nextcloud/remote.php/dav", "^/.well-known/carddav" => "/nextcloud/remote.php/dav" )' > /etc/lighttpd/conf-available/99-dietpi-dav_redirect.conf @@ -8205,7 +8216,18 @@ The install script will now exit. After applying one of the the above, rerun die # - Enable Redis socket and grant www-data access to it: # - NB: To allow wildcard expansion, do not use quotes around $redis_conf! GCI_PRESERVE=1 G_CONFIG_INJECT 'unixsocket[[:blank:]]' 'unixsocket /var/run/redis/redis-server.sock' $redis_conf - G_CONFIG_INJECT 'unixsocketperm[[:blank:]]' 'unixsocketperm 770' $redis_conf + # - Current Buster PHP7.3 Redis module cannot access Redis socket even with group + 770 permissions. + # - Obviously group of spawned processes is overridden by only www-data while redis membership is lost. + # - Requires secure solution, however for now we workaround with 777 socket permissions. + if (( $G_DISTRO > 4 )); then + + G_CONFIG_INJECT 'unixsocketperm[[:blank:]]' 'unixsocketperm 777' $redis_conf + + else + + G_CONFIG_INJECT 'unixsocketperm[[:blank:]]' 'unixsocketperm 770' $redis_conf + + fi local redis_sock=$(grep -m1 '^[[:blank:]]*unixsocket[[:blank:]]' $redis_conf | mawk '{print $2}') usermod -a -G redis www-data G_RUN_CMD systemctl restart redis-server @@ -8231,12 +8253,28 @@ The install script will now exit. After applying one of the the above, rerun die Banner_Configuration G_DIETPI-NOTIFY 2 'Configuring TURN server:' - # - Enable init.d service - G_CONFIG_INJECT 'TURNSERVER_ENABLED=' 'TURNSERVER_ENABLED=1' /etc/default/coturn - # - Disable coturn logging by default, this can be overridden via /etc/turnserver.conf - G_CONFIG_INJECT 'DAEMON_ARGS=' "DAEMON_ARGS='-c /etc/turnserver.conf -o -l stdout --no-stdout-log --simple-log'" /etc/default/coturn + # Buster (systemd unit) + if (( $G_DISTRO > 4 )); then - # - Ask user for server domain and desired TURN server port + # - Remove init.d service traces + [[ -f /etc/init.d/coturn ]] && rm /etc/init.d/coturn + [[ -f /etc/default/coturn ]] && rm /etc/default/coturn + + # - Disable coturn logging by default, this can be overridden via /etc/turnserver.conf + mkdir -p /etc/systemd/system/coturn.service.d + echo -e "[Service]\nExecStart=\n$(grep -m1 "^[[:blank:]]*ExecStart=" /lib/systemd/system/coturn.service) -l stdout --no-stdout-log --simple-log" > /etc/systemd/system/coturn.service.d/dietpi-logging.conf + + # Stretch/Jessie (init.d service) + else + + # - Enable init.d service + G_CONFIG_INJECT 'TURNSERVER_ENABLED=' 'TURNSERVER_ENABLED=1' /etc/default/coturn + # - Disable coturn logging by default, this can be overridden via /etc/turnserver.conf + G_CONFIG_INJECT 'DAEMON_ARGS=' "DAEMON_ARGS='-c /etc/turnserver.conf -o -l stdout --no-stdout-log --simple-log'" /etc/default/coturn + + fi + + # Ask user for server domain and desired TURN server port local invalid_text='' local domain=$(hostname) while : @@ -8277,7 +8315,14 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal done - # - Adjust coturn settings + # Adjust coturn settings + # - On Buster by default /etc/turnserver.conf is not created. Use example or create empty file: + if [[ ! -f /etc/turnserver.conf ]]; then + + > /etc/turnserver.conf + [[ -f /usr/share/doc/coturn/examples/etc/turnserver.conf.gz ]] && gzip -cd /usr/share/doc/coturn/examples/etc/turnserver.conf.gz > /etc/turnserver.conf + + fi G_CONFIG_INJECT 'fingerprint' 'fingerprint' /etc/turnserver.conf G_CONFIG_INJECT 'use-auth-secret' 'use-auth-secret' /etc/turnserver.conf G_CONFIG_INJECT 'realm=' "realm=$domain" /etc/turnserver.conf @@ -8287,7 +8332,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal G_CONFIG_INJECT 'no-loopback-peers' 'no-loopback-peers' /etc/turnserver.conf G_CONFIG_INJECT 'no-multicast-peers' 'no-multicast-peers' /etc/turnserver.conf - # - Add TLS settings, if LetsEncrypt certificates are available: + # Add TLS settings, if LetsEncrypt certificates are available: if [[ -f /DietPi/dietpi/.dietpi-letsencrypt && -f /etc/letsencrypt/live/$(sed -n 1p /DietPi/dietpi/.dietpi-letsencrypt)/cert.pem ]]; then @@ -8307,19 +8352,19 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal fi - # - Install Nextcloud Talk app + # Install Nextcloud Talk app G_RUN_CMD systemctl start $MARIADB_SERVICE G_RUN_CMD systemctl start redis-server G_RUN_CMD ncc maintenance:mode --off - G_RUN_CMD ncc app:install spreed + [[ -d /var/www/nextcloud/apps/spreed ]] || G_RUN_CMD ncc app:install spreed ncc app:enable spreed - # - Adjust Nextcloud Talk settings to use coturn + # Adjust Nextcloud Talk settings to use coturn ncc config:app:set spreed stun_servers --value="[\"$domain:$port\"]" - # Generate random secret to secure TURN server access + # - Generate random secret to secure TURN server access local secret=$(openssl rand -hex 32) GCI_PRESERVE=1 G_CONFIG_INJECT 'static-auth-secret=' "static-auth-secret=$secret" /etc/turnserver.conf - # Scrape existing secret, in case user manually chose/edited it + # - Scrape existing secret, in case user manually chose/edited it secret=$(grep -m1 '^[[:blank:]]*static-auth-secret=' /etc/turnserver.conf) secret=${secret#*static-auth-secret=} ncc config:app:set spreed turn_servers --value="[{\"server\":\"$domain:$port\",\"secret\":\"$secret\",\"protocols\":\"udp,tcp\"}]" @@ -10611,7 +10656,7 @@ Redirect permanent /.well-known/caldav /baikal/html/dav.php' > /etc/apache2/conf elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )); then echo '# Redirect Cal/CardDAV requests to Baikal endpoint: -url.redirect = ( +url.redirect += ( "^/.well-known/caldav" => "/baikal/html/dav.php", "^/.well-known/carddav" => "/baikal/html/dav.php" )' > /etc/lighttpd/conf-available/99-dietpi-dav_redirect.conf @@ -12739,8 +12784,7 @@ _EOF_ fi - #ownCloud - software_id=47 + software_id=47 # ownCloud if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -12784,21 +12828,22 @@ _EOF_ fi - #Nextcloud Talk + TURN server "coturn" - software_id=168 + software_id=168 # Nextcloud Talk + TURN server "coturn" if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP coturn + [[ -f /etc/turnserver.conf ]] && rm /etc/turnserver.conf + [[ -d /etc/systemd/system/coturn.service.d ]] && rm -R /etc/systemd/system/coturn.service.d systemctl start $MARIADB_SERVICE + systemctl start redis-server ncc maintenance:mode --off ncc app:disable spreed G_DIETPI-NOTIFY 2 'Disabled Nextcloud Talk app, but you need to remove it manually from Nextcloud web UI, if desired.' fi - #Nextcloud - software_id=114 + software_id=114 # Nextcloud if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling diff --git a/dietpi/patch_file b/dietpi/patch_file index 40998b7cdd..d05cfac0f0 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1681,6 +1681,32 @@ _EOF_ openssl enc -e -a -md sha256 -aes-256-cbc -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $global_pw + fi + #------------------------------------------------------------------------------- + #Nextcloud: Add OCM/OCS provider redirects as this is checked and printed as warning on admin panel: https://github.com/MichaIng/DietPi/issues/2638 + if [[ -f /etc/apache2/sites-available/dietpi-nextcloud.conf ]] && + ! grep -qE '(ocm|ocs)-provider' /etc/apache2/sites-available/dietpi-nextcloud.conf; then + + echo 'Redirect permanent /ocm-provider /nextcloud/ocm-provider +Redirect permanent /ocs-provider /nextcloud/ocs-provider' >> /etc/apache2/sites-available/dietpi-nextcloud.conf + + fi + if [[ -f /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf ]] && + ! grep -qE '(ocm|ocs)-provider' /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf; then + + echo 'url.redirect += ( + "^/ocm-provider" => "/nextcloud/ocm-provider", + "^/ocs-provider" => "/nextcloud/ocs-provider" +)' >> /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf + + fi + if [[ -f /etc/nginx/sites-dietpi/dietpi-nextcloud.conf ]] && + ! grep -qE '(ocm|ocs)-provider' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf; then + + echo 'location ~ ^\/(?:ocm-provider|ocs-provider).* { + rewrite ^ /nextcloud$request_uri; +}' >> /etc/nginx/sites-dietpi/dietpi-nextcloud.conf + fi #------------------------------------------------------------------------------- #Reinstalls From 2b0a4dabcafc0b165224a4b05d069383a0bd9352 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Mar 2019 16:40:18 +0100 Subject: [PATCH 196/232] v6.22 + DietPi-Patch | Tiny coding --- dietpi/patch_file | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index d05cfac0f0..5f99aab7a1 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1685,23 +1685,23 @@ _EOF_ #------------------------------------------------------------------------------- #Nextcloud: Add OCM/OCS provider redirects as this is checked and printed as warning on admin panel: https://github.com/MichaIng/DietPi/issues/2638 if [[ -f /etc/apache2/sites-available/dietpi-nextcloud.conf ]] && - ! grep -qE '(ocm|ocs)-provider' /etc/apache2/sites-available/dietpi-nextcloud.conf; then + ! grep -q 'oc[ms]-provider' /etc/apache2/sites-available/dietpi-nextcloud.conf; then echo 'Redirect permanent /ocm-provider /nextcloud/ocm-provider Redirect permanent /ocs-provider /nextcloud/ocs-provider' >> /etc/apache2/sites-available/dietpi-nextcloud.conf fi if [[ -f /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf ]] && - ! grep -qE '(ocm|ocs)-provider' /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf; then + ! grep -q 'oc[ms]-provider' /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf; then echo 'url.redirect += ( - "^/ocm-provider" => "/nextcloud/ocm-provider", + "^/ocm-provider" => "/nextcloud/ocm-provider", "^/ocs-provider" => "/nextcloud/ocs-provider" )' >> /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf fi if [[ -f /etc/nginx/sites-dietpi/dietpi-nextcloud.conf ]] && - ! grep -qE '(ocm|ocs)-provider' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf; then + ! grep -q 'oc[ms]-provider' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf; then echo 'location ~ ^\/(?:ocm-provider|ocs-provider).* { rewrite ^ /nextcloud$request_uri; From 813c212ab71e6d2621936deb09b7bde6ed783a77 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Mar 2019 18:26:19 +0100 Subject: [PATCH 197/232] v6.22 + DietPi-Globals | G_OBTAIN_CPU_TEMP(): Speed up by coding simplifications --- dietpi/func/dietpi-globals | 83 ++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 43 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 19f52a9e39..9c651cf462 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1838,82 +1838,79 @@ $print_logfile_info # print_full_info=1# optional input to print full colour text output and temp warnings. G_OBTAIN_CPU_TEMP(){ - local cpu_temp_current='N/A' #We must always return a value, due to VM lacking this feature + benchmark online + local cpu_temp_current='N/A' # We must always return a value, due to VM lacking this feature + benchmark online local print_full_info=${print_full_info:-0} - # - Array to store possible locations for temp read. - afp_temperature=( + # Read CPU temp from file + # - Sparky/Asus: Requires special case as in others array this would break other SBC temp readouts with 2 zones + if (( $G_HW_MODEL == 70 || $G_HW_MODEL == 52 )); then - #'/sys/class/thermal/thermal_zone1/temp' #sparky/Asus, will break other SBC temp readouts as most have 2 zones, needs a special case - '/sys/class/thermal/thermal_zone0/temp' - '/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input' - '/sys/class/hwmon/hwmon0/device/temp_label' + cpu_temp_current=$(= 150 )) && cpu_temp_current=$(mawk '{print $1/1000}' <<< "$cpu_temp_current" | xargs printf "%0.0f") + # Format output + # - Check for valid value + if ! disable_error=1 G_CHECK_VALIDINT "$cpu_temp_current" 1; then - # - Native PC + possibily others, due to vast sensors /sys/class/thermal/thermal_zone[0-9], all of which we are unsure is CPU, check for possible invalid entries and set N/A - # EG: Z83 = 0, also seen some results as a minus value - if ! disable_error=1 G_CHECK_VALIDINT $cpu_temp_current || (( $cpu_temp_current <= 0 )); then + cpu_temp_current='N/A' - cpu_temp_current='N/A' + else - elif (( $print_full_info )); then + # - 2/5 digit output? + (( $cpu_temp_current >= 150 )) && cpu_temp_current=$(mawk '{print $1/1000}' <<< $cpu_temp_current | xargs printf "%0.0f") - local cpu_temp_current_f=$(( $cpu_temp_current * 9/5 + 32 )) - if (( $cpu_temp_current >= 70 )); then + if (( $print_full_info )); then - cpu_temp_current="\e[1;31mWarning: $cpu_temp_current'C : $cpu_temp_current_f'F (Reducing the life of your device)\e[0m" + local cpu_temp_current_f=$(( $cpu_temp_current * 9/5 + 32 )) + if (( $cpu_temp_current >= 70 )); then - elif (( $cpu_temp_current >= 60 )); then + cpu_temp_current="\e[1;31mWARNING: $cpu_temp_current'C : $cpu_temp_current_f'F (Reducing the life of your device)\e[0m" - cpu_temp_current="\e[38;5;202m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running hot, not recommended)\e[0m" + elif (( $cpu_temp_current >= 60 )); then - elif (( $cpu_temp_current >= 50 )); then + cpu_temp_current="\e[38;5;202m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running hot, not recommended)\e[0m" - cpu_temp_current="\e[1;33m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running warm, but safe)\e[0m" + elif (( $cpu_temp_current >= 50 )); then - elif (( $cpu_temp_current >= 40 )); then + cpu_temp_current="\e[1;33m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running warm, but safe)\e[0m" - cpu_temp_current="\e[1;32m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Optimal temperature)\e[0m" + elif (( $cpu_temp_current >= 40 )); then - elif (( $cpu_temp_current >= 30 )); then + cpu_temp_current="\e[1;32m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Optimal temperature)\e[0m" - cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Cool runnings)\e[0m" + elif (( $cpu_temp_current >= 30 )); then - else + cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Cool runnings)\e[0m" - cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Who put me in the freezer!)\e[0m" + else - fi + cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Who put me in the freezer!)\e[0m" fi - break - fi - done - - unset afp_temperature + fi echo -e "$cpu_temp_current" From f6fff7d4baf7f17080c8ab5b931487e7e1d5bed3 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Mar 2019 18:58:47 +0100 Subject: [PATCH 198/232] v6.22 + DietPi-Banner | If CPU temp readout is not supported on current device, show free space --- dietpi/func/dietpi-banner | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 6ae252d9cc..ddfad0fddd 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -23,8 +23,7 @@ G_INIT # Import DietPi-Globals -------------------------------------------------------------- - INPUT=0 - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 #///////////////////////////////////////////////////////////////////////////////////// # Globals @@ -64,9 +63,6 @@ Obtain_Update_Available - # Try to re-obtain IP if missing - [[ $IP_ADDRESS ]] || Update_Ip_Address - # Update Available? local text_update_available_date='' if (( $UPDATE_AVAILABLE )); then @@ -83,15 +79,29 @@ else - text_update_available_date="$(date +"%a %x - %R")" + text_update_available_date=$(date +"%a %x - %R") + + fi + + # CPU temp supported? Otherwise show free space + local text_hw_info=$(print_full_info=1 G_OBTAIN_CPU_TEMP) + if [[ $text_hw_info == 'N/A' ]]; then + + text_hw_info=$(G_CHECK_FREESPACE /) + # - Show GiB if > 9999 MiB + (( $text_hw_info > 9999 )) && text_hw_info="$(( $text_hw_info / 1024 )) GiB" || text_hw_info+=' MiB' + text_hw_info="RootFS free space: $text_hw_info" fi + # Try to re-obtain IP if missing + [[ $IP_ADDRESS ]] || Update_Ip_Address + echo -e "\ $green_line \e[1mDietPi v$DIETPI_VERSION\e[0m \e[90m| $text_update_available_date\e[0m $green_line - \e[1m$G_HW_MODEL_DESCRIPTION\e[0m \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP)\e[0m + \e[1m$G_HW_MODEL_DESCRIPTION\e[0m \e[90m| $text_hw_info\e[0m $green_line \e[1m$IP_ADAPTER ($IP_ADDRESS)\e[0m $green_line @@ -112,7 +122,7 @@ echo -e "\e[90m Image : $image_creator (pre-image: $preimage_name)\e[0m" - IMAGE_ADDITIONAL_CREDITS='' + unset IMAGE_ADDITIONAL_CREDITS fi From 67161a7a96a830d4d63be40f4084c9e32a3c6c66 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Mar 2019 19:03:00 +0100 Subject: [PATCH 199/232] v6.22 + CHANGELOG | DietPi-Banner: If CPU temps are not supported by device, RootFS free space is shown instead --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8352500203..39f214f52b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,7 +6,7 @@ Changes / Improvements / Optimisations: - Security | The DietPi-Software global password is now stored with enhanced security which also resolves a warning on Buster systems: https://github.com/MichaIng/DietPi/issues/2213 - System | /etc/bashrc.d/ now allows ".bash" file ending as well. Merged all contained DietPi scripts into one: /etc/bashrc.d/dietpi.bash. https://github.com/MichaIng/DietPi/pull/2636 - General | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives. This allows us to lower DietPi core package dependencies from "p7zip-full" to "p7zip". -- General | CPU temps (if available on the device) now displayed in the login banners. Many thanks to esturniolo for the suggestion: https://twitter.com/esturniolo/status/1104912062298423297 +- General | CPU temps are now displayed in the login banners. If unsupported by current device, free space on RootFS is shown instead. Many thanks to esturniolo for the suggestion: https://twitter.com/esturniolo/status/1104912062298423297 - RPi | DietPi does not set or change "framebuffer_depth" in config.txt anymore which defaults to 16 which works in every known case. It will be re-added as fast as we find a case where another value is required. - DietPi-NordVPN | Added sent/received usage stats for VPN tunnel. - DietPi-Sync | Sync will now abort if the source dir is empty. Merged dry run into real sync, as this was performed anyway to do required free space check. When "Sync" is selected, after dry run the user is presented a summary and given the option to view the detailed dry run log, cancel or continue with real sync. Some other minor fixes and enhancements have been applied as well. Many thanks to @midnightwatcher for doing this request: https://dietpi.com/phpbb/viewtopic.php?f=12&t=5588 From 14471cbe0c077ff6ccf81708fa3e704b4a17ce62 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Mar 2019 19:05:08 +0100 Subject: [PATCH 200/232] v6.22 + DietPi-Globals | Syntax --- dietpi/func/dietpi-globals | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 9c651cf462..a0b38481ba 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1864,9 +1864,9 @@ $print_logfile_info [[ -f $i ]] && { cpu_temp_current=$(<$i); break; } - fi + done - done + fi # Format output # - Check for valid value From da4eefee21a7a8b390f6bfe1c002309431fa981a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 17 Mar 2019 03:32:51 +0100 Subject: [PATCH 201/232] META | Add further links to the Additional Software list --- README.md | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8b6be71ed9..b25f6d8abc 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Use `dietpi-software` to quickly and easily install popular software that's "Rea ### Lead -**Micha (MichaIng)** +#### Micha (MichaIng) Project lead of DietPi (20/02/2019 and onwards), source code contributor, bug fixes, software improvements, DietPi forum administrator. @@ -169,30 +169,38 @@ along with this program. If not, see https://www.gnu.org/licenses/ ### DietPi Source - Source: https://github.com/MichaIng/DietPi -- Build: Not applicable (as DietPi currently uses Bash scripts, no building or compiling is required). +- Build: Not applicable, as DietPi uses Bash scripts only, no building or compiling is required. ### DietPi file list - All files located in (recursively): - - `/boot/dietpi/` - - `/DietPi/dietpi/` + - `/DietPi/` - `/var/lib/dietpi/` - `/var/tmp/dietpi/` -- `/DietPi/dietpi.txt` -- `/DietPi/config.txt` (RPi) -- `/DietPi/boot.ini` (Odroid) + - `/boot/dietpi/` +- `/boot/dietpi.txt` +- `/boot/config.txt` (RPi) +- `/boot/boot.ini` (Odroid) - All files prefixed with: `dietpi-` > The above GPLv2 documentation also applies to all mentioned files! ### Additional Software -Links to additional software used in DietPi and their source and build instructions (where applicable): +Links to additional software used in DietPi and their source and build instructions where applicable: -- [Raspberry Pi](https://github.com/raspberrypi) +- [Linux kernel](https://github.com/torvalds/linux) +- [GNU operating sytem](https://www.gnu.org/) +- [Debian distribution](https://salsa.debian.org/) +- [Raspberry](https://github.com/raspberrypi) [Pi](https://github.com/RPi-Distro) - [Odroid](https://github.com/hardkernel?tab=repositories) - [FriendlyARM](https://github.com/friendlyarm?tab=repositories) -- [LXDE](https://github.com/LXDE) +- [X.Org-X-Server](https://www.x.org/archive//individual/) +- [LXDE desktop](https://github.com/LXDE) +- [Xfce desktop](https://git.xfce.org/) +- [MATE desktop](https://github.com/mate-desktop) +- [GNUstep](https://github.com/gnustep) +- [Chromium](https://chromium.googlesource.com/chromium/src/) - [Kodi/XBMC](https://github.com/xbmc/xbmc) - [Transmission](https://transmissionbt.com/download/) - [Nextcloud](https://github.com/nextcloud/server) From 1a4585889731ec7d69fe019bc8d86b9e4dd7c864 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 17 Mar 2019 14:57:00 +0000 Subject: [PATCH 202/232] Create myip.php https://github.com/MichaIng/DietPi/issues/2627#issuecomment-473673087 --- .meta/myip.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 .meta/myip.php diff --git a/.meta/myip.php b/.meta/myip.php new file mode 100644 index 0000000000..bad0b811f7 --- /dev/null +++ b/.meta/myip.php @@ -0,0 +1 @@ + From 509f95f30e71f805d4081e5ee9afab89471191ed Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 17 Mar 2019 15:05:59 +0000 Subject: [PATCH 203/232] v6.22 + Improve code to check for forwarding/proxy etc. --- .meta/myip.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.meta/myip.php b/.meta/myip.php index bad0b811f7..5ce00ccef5 100644 --- a/.meta/myip.php +++ b/.meta/myip.php @@ -1 +1,18 @@ - + From 07051e877ad15050ab0efc57b5d017167a17c22a Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 18 Mar 2019 16:06:51 +0000 Subject: [PATCH 204/232] v6.22 + WIP dietpi-banner changes. NB: need to add back in reobtain IP details if not found at time. --- dietpi/func/dietpi-banner | 179 ++++++++++++++++++++++++++++++-------- 1 file changed, 144 insertions(+), 35 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index ddfad0fddd..5eb3abfe4a 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -31,15 +31,91 @@ DIETPI_VERSION="$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC" [[ $G_GITBRANCH != 'master' ]] && DIETPI_VERSION+=" ($G_GITBRANCH)" - IMAGE_ADDITIONAL_CREDITS=$(sed -n 8p /DietPi/dietpi/.hw_model) - - IP_ADDRESS=$(sed -n 4p /DietPi/dietpi/.network) - IP_ADAPTER=$(sed -n 3p /DietPi/dietpi/.network) Update_Ip_Address(){ /DietPi/dietpi/func/obtain_network_details - IP_ADDRESS=$(sed -n 4p /DietPi/dietpi/.network) - IP_ADAPTER=$(sed -n 3p /DietPi/dietpi/.network) + + } + + ##### + aOBTAIN=( + + 'sed -n 3p /DietPi/dietpi/.network' #0: 'Active IP adapter' + 'sed -n 4p /DietPi/dietpi/.network' #1: 'LAN IP address' + 'wget -q -O- --timeout=2 --tries=1 https://dietpi.com/myip.php' #2: 'WAN IP address' + + ) + + aENABLED=() + aDESCRIPTION=( + + 'Device model' + 'CPU Temp' + 'LAN IP' + 'WAN IP' + 'Freespace (RootFS)' + 'Freespace (DietPi Userdata)' + 'Display DietPi credits?' + 'Display DietPi useful commands?' + + ) + + FP_SAVEFILE='/DietPi/dietpi/.dietpi-banner' + + Load(){ + + for ((i=0; i<${#aDESCRIPTION[@]}; i++)) + do + + aENABLED[$i]=0 + + done + + #Default enabled options?? aENABLED[0]=1 + + [[ -f $FP_SAVEFILE ]] && . $FP_SAVEFILE + + } + + Save(){ + + [[ -f $FP_SAVEFILE ]] && rm $FP_SAVEFILE + + for ((i=0; i<${#aENABLED[@]}; i++)) + do + + echo -e "aENABLED[$i]=${aENABLED[$i]}" >> $FP_SAVEFILE + + done + + } + + Menu_Main(){ + + G_WHIP_CHECKLIST_ARRAY=() + + for ((i=0; i<${#aDESCRIPTION[@]}; i++)) + do + + local state='off' + (( ${aENABLED[$i]} == 1 )) && state='on' + + aENABLED[$i]=0 + + G_WHIP_CHECKLIST_ARRAY+=($i "${aDESCRIPTION[$i]}" $state) + + done + + if G_WHIP_CHECKLIST "Please select options to enable in $G_PROGRAM_NAME display"; then + + for i in ${G_WHIP_RETURNED_VALUE[@]} + do + + aENABLED[$i]=1 + + done + + fi } @@ -47,7 +123,7 @@ UPDATE_AVAILABLE_VERSION='' # -1 = image required, other value = latest version Obtain_Update_Available(){ - # Update Available + # Update Available? if [[ -f '/DietPi/dietpi/.update_available' ]]; then UPDATE_AVAILABLE=1 @@ -59,11 +135,11 @@ Print_Header(){ - local green_line='\e[38;5;154m─────────────────────────────────────────────────────\e[0m' - - Obtain_Update_Available + local green_line=' \e[38;5;154m─────────────────────────────────────────────────────\e[0m' + local green_bullet='\e[38;5;154m -\e[0m' # Update Available? + Obtain_Update_Available local text_update_available_date='' if (( $UPDATE_AVAILABLE )); then @@ -79,33 +155,41 @@ else - text_update_available_date=$(date +"%a %x - %R") + text_update_available_date=$(date +"%R - %a %x") fi - # CPU temp supported? Otherwise show free space - local text_hw_info=$(print_full_info=1 G_OBTAIN_CPU_TEMP) - if [[ $text_hw_info == 'N/A' ]]; then + echo -e "\ +$green_line + \e[1mDietPi v$DIETPI_VERSION\e[0m \e[90m| $text_update_available_date\e[0m +$green_line" + + local index=0 + index=0; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m" + index=1; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP)\e[0m" + index=2; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[1]}) ($(${aOBTAIN[0]}))\e[0m" + index=3; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[2]})\e[0m" - text_hw_info=$(G_CHECK_FREESPACE /) + index=4; if (( ${aENABLED[$index]} )); then + + local freespace=$(G_CHECK_FREESPACE /) # - Show GiB if > 9999 MiB - (( $text_hw_info > 9999 )) && text_hw_info="$(( $text_hw_info / 1024 )) GiB" || text_hw_info+=' MiB' - text_hw_info="RootFS free space: $text_hw_info" + (( $freespace > 9999 )) && freespace="$(( $freespace / 1024 )) GiB" || freespace+=' MiB' + freespace="$freespace" + echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $freespace\e[0m" fi + index=5; if (( ${aENABLED[$index]} )); then + + local freespace=$(G_CHECK_FREESPACE /mnt/dietpi_userdata) + # - Show GiB if > 9999 MiB + (( $freespace > 9999 )) && freespace="$(( $freespace / 1024 )) GiB" || freespace+=' MiB' + freespace="$freespace" + echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $freespace\e[0m" - # Try to re-obtain IP if missing - [[ $IP_ADDRESS ]] || Update_Ip_Address + fi - echo -e "\ - $green_line - \e[1mDietPi v$DIETPI_VERSION\e[0m \e[90m| $text_update_available_date\e[0m - $green_line - \e[1m$G_HW_MODEL_DESCRIPTION\e[0m \e[90m| $text_hw_info\e[0m - $green_line - \e[1m$IP_ADAPTER ($IP_ADDRESS)\e[0m - $green_line -" + echo -e "$green_line\n" } @@ -130,12 +214,10 @@ Patreon Legends : PINE64 community Donate : https://DietPi.com/#donate' - [[ $IMAGE_ADDITIONAL_CREDITS ]] && echo -e "\n\ Device image possible thanks to: $IMAGE_ADDITIONAL_CREDITS" + local image_additional_credits=$(sed -n 8p /DietPi/dietpi/.hw_model) + [[ $image_additional_credits ]] && echo -e "\n\ Device image possible thanks to: $image_additional_credits" - echo -e ' DietPi Hosting : Powered by https://MyVirtualServer.com\e[0m\n -\e[1m dietpi-launcher\e[0m = All the DietPi programs in one place. -\e[1m dietpi-config\e[0m = Feature rich configuration tool for your device. -\e[1m dietpi-software\e[0m = Select optimized software for installation.' + echo -e ' DietPi Hosting : Powered by https://MyVirtualServer.com\e[0m' # Update available? if (( $UPDATE_AVAILABLE )); then @@ -152,7 +234,16 @@ fi - echo -e '\e[1m htop\e[0m = Resource monitor. + echo '' + + } + + Useful_Commands_Print(){ + + echo -e '\e[1m dietpi-launcher\e[0m = All the DietPi programs in one place. +\e[1m dietpi-config\e[0m = Feature rich configuration tool for your device. +\e[1m dietpi-software\e[0m = Select optimized software for installation. +\e[1m htop\e[0m = Resource monitor. \e[1m cpu\e[0m = Shows CPU information and stats.\n' } @@ -160,6 +251,11 @@ #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// + + #----------------------------------------------------------------------------------- + Load + #----------------------------------------------------------------------------------- + if (( $INPUT == 0 )); then Print_Header @@ -168,10 +264,23 @@ printf '\ec' # clear current terminal screen Print_Header - Credits_Print + (( ${aENABLED[6]} )) && Credits_Print + (( ${aENABLED[7]} )) && Useful_Commands_Print + + elif (( $INPUT == 2 )); then + + Menu_Main + + printf '\ec' # clear current terminal screen + Print_Header + (( ${aENABLED[6]} )) && Credits_Print + (( ${aENABLED[7]} )) && Useful_Commands_Print + fi + #----------------------------------------------------------------------------------- + Save #----------------------------------------------------------------------------------- exit 0 #----------------------------------------------------------------------------------- From fd792468202f1030e2ce559daac5ecbdd328f538 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 18 Mar 2019 16:13:50 +0000 Subject: [PATCH 205/232] v6.22 + Tweaks --- dietpi/func/dietpi-banner | 43 ++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 5eb3abfe4a..b888dd5359 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -30,6 +30,7 @@ #///////////////////////////////////////////////////////////////////////////////////// DIETPI_VERSION="$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC" [[ $G_GITBRANCH != 'master' ]] && DIETPI_VERSION+=" ($G_GITBRANCH)" + GREEN_LINE=' \e[38;5;154m─────────────────────────────────────────────────────\e[0m' Update_Ip_Address(){ @@ -71,9 +72,20 @@ done - #Default enabled options?? aENABLED[0]=1 + if [[ -f $FP_SAVEFILE ]]; then - [[ -f $FP_SAVEFILE ]] && . $FP_SAVEFILE + . $FP_SAVEFILE + + else + + #Set Default options + aENABLED[0]=1 + aENABLED[1]=1 + aENABLED[2]=1 + aENABLED[6]=1 + aENABLED[7]=1 + + fi } @@ -100,7 +112,7 @@ local state='off' (( ${aENABLED[$i]} == 1 )) && state='on' - aENABLED[$i]=0 + aENABLED[$i]=0 #Change this to temp array, incase user cancels and we dont have to reset their previious options G_WHIP_CHECKLIST_ARRAY+=($i "${aDESCRIPTION[$i]}" $state) @@ -115,6 +127,8 @@ done + Save + fi } @@ -135,9 +149,6 @@ Print_Header(){ - local green_line=' \e[38;5;154m─────────────────────────────────────────────────────\e[0m' - local green_bullet='\e[38;5;154m -\e[0m' - # Update Available? Obtain_Update_Available local text_update_available_date='' @@ -160,9 +171,15 @@ fi echo -e "\ -$green_line +$GREEN_LINE \e[1mDietPi v$DIETPI_VERSION\e[0m \e[90m| $text_update_available_date\e[0m -$green_line" +$GREEN_LINE" + + } + + Print_Banner(){ + + local green_bullet='\e[38;5;154m -\e[0m' local index=0 index=0; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m" @@ -179,6 +196,7 @@ $green_line" echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $freespace\e[0m" fi + index=5; if (( ${aENABLED[$index]} )); then local freespace=$(G_CHECK_FREESPACE /mnt/dietpi_userdata) @@ -189,7 +207,7 @@ $green_line" fi - echo -e "$green_line\n" + echo -e "$GREEN_LINE\n" } @@ -206,8 +224,6 @@ $green_line" echo -e "\e[90m Image : $image_creator (pre-image: $preimage_name)\e[0m" - unset IMAGE_ADDITIONAL_CREDITS - fi echo -e '\e[90m Web : https://DietPi.com | https://twitter.com/dietpi_ @@ -264,6 +280,7 @@ $green_line" printf '\ec' # clear current terminal screen Print_Header + Print_Banner (( ${aENABLED[6]} )) && Credits_Print (( ${aENABLED[7]} )) && Useful_Commands_Print @@ -273,14 +290,12 @@ $green_line" printf '\ec' # clear current terminal screen Print_Header + Print_Banner (( ${aENABLED[6]} )) && Credits_Print (( ${aENABLED[7]} )) && Useful_Commands_Print - fi - #----------------------------------------------------------------------------------- - Save #----------------------------------------------------------------------------------- exit 0 #----------------------------------------------------------------------------------- From 8bcbed62a5ccf8d0d6c733025f3d70d482f17700 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Mon, 18 Mar 2019 16:21:34 +0000 Subject: [PATCH 206/232] v6.22 + Minor tweak --- dietpi/func/dietpi-banner | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index b888dd5359..cd820b55b3 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -43,7 +43,7 @@ 'sed -n 3p /DietPi/dietpi/.network' #0: 'Active IP adapter' 'sed -n 4p /DietPi/dietpi/.network' #1: 'LAN IP address' - 'wget -q -O- --timeout=2 --tries=1 https://dietpi.com/myip.php' #2: 'WAN IP address' + 'wget -q -O- --timeout=2 --tries=1 https://dietpi.com/myip.php' #2: 'WAN IP address' # Move this to /DietPi/dietpi/.network? ) @@ -209,6 +209,9 @@ $GREEN_LINE" echo -e "$GREEN_LINE\n" + (( ${aENABLED[6]} )) && Credits_Print + (( ${aENABLED[7]} )) && Useful_Commands_Print + } Credits_Print(){ @@ -281,8 +284,6 @@ $GREEN_LINE" printf '\ec' # clear current terminal screen Print_Header Print_Banner - (( ${aENABLED[6]} )) && Credits_Print - (( ${aENABLED[7]} )) && Useful_Commands_Print elif (( $INPUT == 2 )); then @@ -291,8 +292,6 @@ $GREEN_LINE" printf '\ec' # clear current terminal screen Print_Header Print_Banner - (( ${aENABLED[6]} )) && Credits_Print - (( ${aENABLED[7]} )) && Useful_Commands_Print fi From 5966cb9d1bf7a474c2c4ee1ed8dc2d5467c382a2 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 19 Mar 2019 13:33:56 +0000 Subject: [PATCH 207/232] v6.22 + - DietPi-Banner | You can now customise which options to display during system login. These include CPU temps, WAN IP, free disk space and more! Simply run 'dietpi-banner': https://github.com/MichaIng/DietPi/issues/2627 + G_CHECK_FREESPACE (info_autoscale). Switched to MB as thats what G_CHECK_FREESPACE uses, and, throughout DietPi I believe. --- CHANGELOG.txt | 2 +- dietpi/func/dietpi-banner | 94 ++++++++++++++++---------------------- dietpi/func/dietpi-globals | 12 ++++- 3 files changed, 51 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 39f214f52b..2debe6867a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,8 +6,8 @@ Changes / Improvements / Optimisations: - Security | The DietPi-Software global password is now stored with enhanced security which also resolves a warning on Buster systems: https://github.com/MichaIng/DietPi/issues/2213 - System | /etc/bashrc.d/ now allows ".bash" file ending as well. Merged all contained DietPi scripts into one: /etc/bashrc.d/dietpi.bash. https://github.com/MichaIng/DietPi/pull/2636 - General | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives. This allows us to lower DietPi core package dependencies from "p7zip-full" to "p7zip". -- General | CPU temps are now displayed in the login banners. If unsupported by current device, free space on RootFS is shown instead. Many thanks to esturniolo for the suggestion: https://twitter.com/esturniolo/status/1104912062298423297 - RPi | DietPi does not set or change "framebuffer_depth" in config.txt anymore which defaults to 16 which works in every known case. It will be re-added as fast as we find a case where another value is required. +- DietPi-Banner | You can now customise which options to display during system login. These include CPU temps, WAN IP, free disk space and more! Simply run 'dietpi-banner': https://github.com/MichaIng/DietPi/issues/2627 - DietPi-NordVPN | Added sent/received usage stats for VPN tunnel. - DietPi-Sync | Sync will now abort if the source dir is empty. Merged dry run into real sync, as this was performed anyway to do required free space check. When "Sync" is selected, after dry run the user is presented a summary and given the option to view the detailed dry run log, cancel or continue with real sync. Some other minor fixes and enhancements have been applied as well. Many thanks to @midnightwatcher for doing this request: https://dietpi.com/phpbb/viewtopic.php?f=12&t=5588 - DietPi-Software | Emby Server: Now installs the latest version automatically (currently 4.0.2) which as well offers a native ARMv8 package: https://github.com/MichaIng/DietPi/pull/2525 diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index cd820b55b3..8acff56cbe 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -30,15 +30,11 @@ #///////////////////////////////////////////////////////////////////////////////////// DIETPI_VERSION="$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC" [[ $G_GITBRANCH != 'master' ]] && DIETPI_VERSION+=" ($G_GITBRANCH)" - GREEN_LINE=' \e[38;5;154m─────────────────────────────────────────────────────\e[0m' - - Update_Ip_Address(){ - /DietPi/dietpi/func/obtain_network_details + FP_SAVEFILE='/DietPi/dietpi/.dietpi-banner' - } + GREEN_LINE=' \e[38;5;154m─────────────────────────────────────────────────────\e[0m' - ##### aOBTAIN=( 'sed -n 3p /DietPi/dietpi/.network' #0: 'Active IP adapter' @@ -51,17 +47,34 @@ aDESCRIPTION=( 'Device model' - 'CPU Temp' + 'CPU temp' 'LAN IP' 'WAN IP' 'Freespace (RootFS)' - 'Freespace (DietPi Userdata)' - 'Display DietPi credits?' + 'Freespace (DietPi userdata)' 'Display DietPi useful commands?' ) - FP_SAVEFILE='/DietPi/dietpi/.dietpi-banner' + Update_Ip_Address(){ + + /DietPi/dietpi/func/obtain_network_details + + } + + UPDATE_AVAILABLE=0 + UPDATE_AVAILABLE_VERSION='' # -1 = image required, other value = latest version + Obtain_Update_Available(){ + + # Update Available? + if [[ -f '/DietPi/dietpi/.update_available' ]]; then + + UPDATE_AVAILABLE=1 + UPDATE_AVAILABLE_VERSION=$( 9999 MiB - (( $freespace > 9999 )) && freespace="$(( $freespace / 1024 )) GiB" || freespace+=' MiB' - freespace="$freespace" - echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $freespace\e[0m" - - fi - - index=5; if (( ${aENABLED[$index]} )); then - - local freespace=$(G_CHECK_FREESPACE /mnt/dietpi_userdata) - # - Show GiB if > 9999 MiB - (( $freespace > 9999 )) && freespace="$(( $freespace / 1024 )) GiB" || freespace+=' MiB' - freespace="$freespace" - echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $freespace\e[0m" - - fi + index=4; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /)\e[0m" + index=5; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /mnt/dietpi_userdata)\e[0m" echo -e "$GREEN_LINE\n" - (( ${aENABLED[6]} )) && Credits_Print - (( ${aENABLED[7]} )) && Useful_Commands_Print + Credits_Print + index=6; (( ${aENABLED[$index]} )) && Useful_Commands_Print } @@ -271,10 +259,6 @@ $GREEN_LINE" # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - #----------------------------------------------------------------------------------- - Load - #----------------------------------------------------------------------------------- - if (( $INPUT == 0 )); then Print_Header @@ -282,11 +266,13 @@ $GREEN_LINE" elif (( $INPUT == 1 )); then printf '\ec' # clear current terminal screen + Load Print_Header Print_Banner elif (( $INPUT == 2 )); then + Load Menu_Main printf '\ec' # clear current terminal screen diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index a0b38481ba..03a76df1be 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -541,6 +541,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then alias dietpi-logclear='/DietPi/dietpi/func/dietpi-logclear' alias dietpi-survey='/DietPi/dietpi/dietpi-survey' alias dietpi-explorer='/DietPi/dietpi/dietpi-explorer' + alias dietpi-banner='/DietPi/dietpi/func/dietpi-banner 2' alias cpu='/DietPi/dietpi/dietpi-cpuinfo' alias 1337='echo Indeed, you are =\)' @@ -1938,19 +1939,26 @@ $print_logfile_info #Check available free space on path, against input value (MB) # - Returns 0=Ok, 1=insufficient space available - # If $2 is not used, returns available space in MB + # If $2 is not used, returns available space in MB | info_autoscale=1 # Prints size type (eg: MB/GB) also scales MB to GB if required # - $1 = path # - $2 = Optional, free space (MB) # EG: if (( $(G_CHECK_FREESPACE /path 100) )); then G_CHECK_FREESPACE(){ + local info_autoscale=${info_autoscale:-0} local return_value=1 local input_path=$1 local input_required_space=$2 local available_space=$(df -mP $input_path | sed -n 2p | mawk '{print $4}') local string_output="Free space check: path=$input_path | available=$available_space MB | required=$input_required_space MB" - if [[ -z $input_required_space ]]; then + if [[ ! $input_required_space ]]; then + + if (( $info_autoscale )); then + + (( $available_space > 9999 )) && available_space="$(( $available_space / 1000 )) GB" || available_space+=' MB' + + fi echo $available_space From 0619acc5c8ba93da33442d8d65f2cf5806ed6463 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 19 Mar 2019 13:38:33 +0000 Subject: [PATCH 208/232] v6.22 + dietpi-banner hostname option https://github.com/MichaIng/DietPi/issues/2627#issuecomment-474045319 --- dietpi/func/dietpi-banner | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 8acff56cbe..d64ba11879 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -40,6 +40,7 @@ 'sed -n 3p /DietPi/dietpi/.network' #0: 'Active IP adapter' 'sed -n 4p /DietPi/dietpi/.network' #1: 'LAN IP address' 'wget -q -O- --timeout=2 --tries=1 https://dietpi.com/myip.php' #2: 'WAN IP address' # Move this to /DietPi/dietpi/.network? + 'hostname' #3: Device hostname ) @@ -53,6 +54,7 @@ 'Freespace (RootFS)' 'Freespace (DietPi userdata)' 'Display DietPi useful commands?' + 'Hostname' ) @@ -191,6 +193,7 @@ $GREEN_LINE" index=1; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP)\e[0m" index=2; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[1]}) ($(${aOBTAIN[0]}))\e[0m" index=3; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[2]})\e[0m" + index=7; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[3]})\e[0m" index=4; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /)\e[0m" index=5; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /mnt/dietpi_userdata)\e[0m" From c8989dda70a522913701656b37de8539474e87b2 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 19 Mar 2019 13:40:41 +0000 Subject: [PATCH 209/232] v6.22 + Minor ordering --- dietpi/func/dietpi-banner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index d64ba11879..460a5cb09e 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -191,9 +191,9 @@ $GREEN_LINE" local index=0 index=0; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m" index=1; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP)\e[0m" + index=7; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[3]})\e[0m" index=2; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[1]}) ($(${aOBTAIN[0]}))\e[0m" index=3; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[2]})\e[0m" - index=7; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[3]})\e[0m" index=4; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /)\e[0m" index=5; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /mnt/dietpi_userdata)\e[0m" From d7daf9f6559d80525fce3c8967f2469c48b0460e Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 19 Mar 2019 13:43:38 +0000 Subject: [PATCH 210/232] v6.22 + Domainname: https://github.com/MichaIng/DietPi/issues/2627 --- dietpi/func/dietpi-banner | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 460a5cb09e..f3f9669cc0 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -40,7 +40,8 @@ 'sed -n 3p /DietPi/dietpi/.network' #0: 'Active IP adapter' 'sed -n 4p /DietPi/dietpi/.network' #1: 'LAN IP address' 'wget -q -O- --timeout=2 --tries=1 https://dietpi.com/myip.php' #2: 'WAN IP address' # Move this to /DietPi/dietpi/.network? - 'hostname' #3: Device hostname + 'hostname' #3: Hostname + 'domainname' #4: Domain name ) @@ -55,6 +56,7 @@ 'Freespace (DietPi userdata)' 'Display DietPi useful commands?' 'Hostname' + 'Domain name' ) @@ -192,6 +194,7 @@ $GREEN_LINE" index=0; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m" index=1; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP)\e[0m" index=7; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[3]})\e[0m" + index=8; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[4]})\e[0m" index=2; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[1]}) ($(${aOBTAIN[0]}))\e[0m" index=3; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[2]})\e[0m" From ed8e4b7e8a8c7165a54c7058dd47c17360a5be86 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 19 Mar 2019 14:58:31 +0000 Subject: [PATCH 211/232] v6.22 beta v2 --- dietpi/server_version-6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index 6dccc4a2f2..8b58001294 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 22 -1 +2 From f44da31bdb578d38b9cabd08e46fa205bfd9db39 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 19 Mar 2019 15:35:15 +0000 Subject: [PATCH 212/232] v6.22 + Weather and uptime: https://github.com/MichaIng/DietPi/issues/2627 --- dietpi/func/dietpi-banner | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index f3f9669cc0..19dc1baa5a 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -42,6 +42,8 @@ 'wget -q -O- --timeout=2 --tries=1 https://dietpi.com/myip.php' #2: 'WAN IP address' # Move this to /DietPi/dietpi/.network? 'hostname' #3: Hostname 'domainname' #4: Domain name + 'curl -sL wttr.in/?format=4' #5: Weather + 'uptime -p' #6: Uptime ) @@ -57,6 +59,8 @@ 'Display DietPi useful commands?' 'Hostname' 'Domain name' + 'Weather (wttr.in)' + 'Uptime' ) @@ -192,6 +196,7 @@ $GREEN_LINE" local index=0 index=0; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m" + index=10; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[6]})\e[0m" index=1; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP)\e[0m" index=7; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[3]})\e[0m" index=8; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[4]})\e[0m" @@ -201,6 +206,8 @@ $GREEN_LINE" index=4; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /)\e[0m" index=5; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /mnt/dietpi_userdata)\e[0m" + index=9; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[5]})\e[0m" + echo -e "$GREEN_LINE\n" Credits_Print From fa40a75fa32ac1bd6edfc46b5606a096dc02edeb Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 19 Mar 2019 18:53:23 +0100 Subject: [PATCH 213/232] v6.22 + myip.php | Minor alignment and wording --- .meta/myip.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.meta/myip.php b/.meta/myip.php index 5ce00ccef5..e363c09294 100644 --- a/.meta/myip.php +++ b/.meta/myip.php @@ -5,13 +5,13 @@ if ($ip) { - echo $ip; + echo $ip; } else { - echo 'Obtain IP failed'; + echo 'Failed to obtain IP'; } From 9ef89c9788b226ebc045ee86861efc6711fcbb2f Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 19 Mar 2019 21:25:20 +0100 Subject: [PATCH 214/232] v6.22 + DietPi-Banner | Function reorder and minor coding --- dietpi/func/dietpi-banner | 205 +++++++++++++++++--------------------- 1 file changed, 90 insertions(+), 115 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 19dc1baa5a..a435d90771 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -1,5 +1,5 @@ #!/bin/bash - +{ #//////////////////////////////////// # DietPi Banner Script # @@ -28,26 +28,8 @@ #///////////////////////////////////////////////////////////////////////////////////// # Globals #///////////////////////////////////////////////////////////////////////////////////// - DIETPI_VERSION="$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC" - [[ $G_GITBRANCH != 'master' ]] && DIETPI_VERSION+=" ($G_GITBRANCH)" - FP_SAVEFILE='/DietPi/dietpi/.dietpi-banner' - GREEN_LINE=' \e[38;5;154m─────────────────────────────────────────────────────\e[0m' - - aOBTAIN=( - - 'sed -n 3p /DietPi/dietpi/.network' #0: 'Active IP adapter' - 'sed -n 4p /DietPi/dietpi/.network' #1: 'LAN IP address' - 'wget -q -O- --timeout=2 --tries=1 https://dietpi.com/myip.php' #2: 'WAN IP address' # Move this to /DietPi/dietpi/.network? - 'hostname' #3: Hostname - 'domainname' #4: Domain name - 'curl -sL wttr.in/?format=4' #5: Weather - 'uptime -p' #6: Uptime - - ) - - aENABLED=() aDESCRIPTION=( 'Device model' @@ -63,18 +45,33 @@ 'Uptime' ) + aOBTAIN=( - Update_Ip_Address(){ + 'sed -n 3p /DietPi/dietpi/.network' #0: 'Active IP adapter' + 'sed -n 4p /DietPi/dietpi/.network' #1: 'LAN IP address' + 'wget -q -O- --timeout=2 --tries=1 https://dietpi.com/myip.php' #2: 'WAN IP address' # Move this to /DietPi/dietpi/.network? + 'hostname' #3: Hostname + 'domainname' #4: Domain name + 'curl -sL wttr.in/?format=4' #5: Weather + 'uptime -p' #6: Uptime - /DietPi/dietpi/func/obtain_network_details + ) + # Set defaults + aENABLED=(1 1 1 0 0 0 1 0 0 0 0) - } + GREEN_LINE=' \e[38;5;154m─────────────────────────────────────────────────────\e[0m' + + # Whole output string + #STRING_BANNER='' + + DIETPI_VERSION="$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC" + [[ $G_GITBRANCH != 'master' ]] && DIETPI_VERSION+=" ($G_GITBRANCH)" + # Update available? UPDATE_AVAILABLE=0 UPDATE_AVAILABLE_VERSION='' # -1 = image required, other value = latest version Obtain_Update_Available(){ - # Update Available? if [[ -f '/DietPi/dietpi/.update_available' ]]; then UPDATE_AVAILABLE=1 @@ -84,77 +81,19 @@ } - Load(){ - - for ((i=0; i<${#aDESCRIPTION[@]}; i++)) - do - - aENABLED[$i]=0 - - done - - if [[ -f $FP_SAVEFILE ]]; then - - . $FP_SAVEFILE - - else - - #Set Default options - aENABLED[0]=1 - aENABLED[1]=1 - aENABLED[2]=1 - aENABLED[6]=1 - - fi - - } + Load(){ [[ -f $FP_SAVEFILE ]] && . $FP_SAVEFILE; } Save(){ - [[ -f $FP_SAVEFILE ]] && rm $FP_SAVEFILE - - for ((i=0; i<${#aENABLED[@]}; i++)) - do - - echo -e "aENABLED[$i]=${aENABLED[$i]}" >> $FP_SAVEFILE + > $FP_SAVEFILE - done - - } - - Menu_Main(){ - - G_WHIP_CHECKLIST_ARRAY=() - - for ((i=0; i<${#aDESCRIPTION[@]}; i++)) + for i in ${!aENABLED[@]} do - local state='off' - (( ${aENABLED[$i]} == 1 )) && state='on' - G_WHIP_CHECKLIST_ARRAY+=($i "${aDESCRIPTION[$i]}" $state) + echo "aENABLED[$i]=${aENABLED[$i]}" >> $FP_SAVEFILE done - if G_WHIP_CHECKLIST "Please select options to enable in $G_PROGRAM_NAME display:"; then - - for ((i=0; i<${#aDESCRIPTION[@]}; i++)) - do - - aENABLED[$i]=0 - - done - - for i in ${G_WHIP_RETURNED_VALUE[@]} - do - - aENABLED[$i]=1 - - done - - Save - - fi - } Print_Header(){ @@ -187,35 +126,7 @@ $GREEN_LINE" } - Print_Banner(){ - - local green_bullet='\e[38;5;154m -\e[0m' - - # - Re-obtain network details if not already done. - [[ ! $(${aOBTAIN[1]}) ]] && Update_Ip_Address - - local index=0 - index=0; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m" - index=10; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[6]})\e[0m" - index=1; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP)\e[0m" - index=7; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[3]})\e[0m" - index=8; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[4]})\e[0m" - index=2; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[1]}) ($(${aOBTAIN[0]}))\e[0m" - index=3; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[2]})\e[0m" - - index=4; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /)\e[0m" - index=5; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /mnt/dietpi_userdata)\e[0m" - - index=9; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[5]})\e[0m" - - echo -e "$GREEN_LINE\n" - - Credits_Print - index=6; (( ${aENABLED[$index]} )) && Useful_Commands_Print - - } - - Credits_Print(){ + Print_Credits(){ echo -e '\e[90m DietPi Team : MichaIng (lead), Daniel Knight (founder)\e[0m' @@ -258,7 +169,7 @@ $GREEN_LINE" } - Useful_Commands_Print(){ + Print_Useful_Commands(){ echo -e '\e[1m dietpi-launcher\e[0m = All the DietPi programs in one place. \e[1m dietpi-config\e[0m = Feature rich configuration tool for your device. @@ -268,6 +179,69 @@ $GREEN_LINE" } + Print_Banner(){ + + local green_bullet='\e[38;5;154m -\e[0m' + + # - Re-obtain network details if not already done. + [[ -f /DietPi/dietpi/.network ]] || /DietPi/dietpi/func/obtain_network_details + + local index=0 + index=0; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m" + index=10; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[6]})\e[0m" + index=1; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP)\e[0m" + index=7; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[3]})\e[0m" + index=8; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[4]})\e[0m" + index=2; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[1]}) ($(${aOBTAIN[0]}))\e[0m" + index=3; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[2]})\e[0m" + + index=4; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /)\e[0m" + index=5; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /mnt/dietpi_userdata)\e[0m" + + index=9; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[5]})\e[0m" + + echo -e "$GREEN_LINE\n" + + Print_Credits + index=6; (( ${aENABLED[$index]} )) && Print_Useful_Commands + + } + + Menu_Main(){ + + G_WHIP_CHECKLIST_ARRAY=() + + for i in ${!aENABLED[@]} + do + + local state='off' + (( ${aENABLED[$i]=0} == 1 )) && state='on' + G_WHIP_CHECKLIST_ARRAY+=($i "${aDESCRIPTION[$i]}" $state) + + done + + if G_WHIP_CHECKLIST "Please select options to enable in $G_PROGRAM_NAME display:"; then + + for i in ${!aENABLED[@]} + do + + aENABLED[$i]=0 + + done + + for i in ${G_WHIP_RETURNED_VALUE[@]} + do + + aENABLED[$i]=1 + + done + + Save + + fi + + } + #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// @@ -297,3 +271,4 @@ $GREEN_LINE" #----------------------------------------------------------------------------------- exit 0 #----------------------------------------------------------------------------------- +} From ddf62f0fa9699c9221068e0d7d3920604ab9cd87 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 20 Mar 2019 02:03:24 +0100 Subject: [PATCH 215/232] v6.22 + DietPi-Globals | G_CHECK_VALIDINT(): Failsafe: Assure $disable_error is either 1 or 0 and that "unset disable_error" always affects the non-local variable if this was set to 1 + DietPi-Globals | G_CHECK_FREESPACE(): Fix MiB => GiB conversion (*1024) and minor coding --- dietpi/func/dietpi-globals | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 03a76df1be..9be89a77fd 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1937,11 +1937,11 @@ $print_logfile_info } - #Check available free space on path, against input value (MB) + #Check available free space on path, against input value (MiB) # - Returns 0=Ok, 1=insufficient space available - # If $2 is not used, returns available space in MB | info_autoscale=1 # Prints size type (eg: MB/GB) also scales MB to GB if required + # If $2 is not used, returns available space in MiB | info_autoscale=1 # Scales MiB to GiB if required and prints unit # - $1 = path - # - $2 = Optional, free space (MB) + # - $2 = Optional, free space (MiB) # EG: if (( $(G_CHECK_FREESPACE /path 100) )); then G_CHECK_FREESPACE(){ @@ -1949,31 +1949,27 @@ $print_logfile_info local return_value=1 local input_path=$1 local input_required_space=$2 - local available_space=$(df -mP $input_path | sed -n 2p | mawk '{print $4}') - local string_output="Free space check: path=$input_path | available=$available_space MB | required=$input_required_space MB" + local available_space=$(df -m --output=avail $input_path | mawk 'NR==2 {print $1;exit}') if [[ ! $input_required_space ]]; then if (( $info_autoscale )); then - (( $available_space > 9999 )) && available_space="$(( $available_space / 1000 )) GB" || available_space+=' MB' + (( $available_space > 9999 )) && available_space="$(( $available_space / 1024 )) GiB" || available_space+=' MiB' fi echo $available_space + return_value=0 elif ! disable_error=1 G_CHECK_VALIDINT $available_space; then G_WHIP_MSG 'G_CHECK_FREESPACE: invalid integer from df result' - elif (( $available_space > $input_required_space )); then - - G_DIETPI-NOTIFY 0 "$string_output" - return_value=0 - else - G_DIETPI-NOTIFY 1 "$string_output" + (( $available_space > $input_required_space )) && return_value=0 + G_DIETPI-NOTIFY $return_value "Free space check: path=$input_path | available=$available_space MiB | required=$input_required_space MiB" fi @@ -1995,7 +1991,7 @@ $print_logfile_info local input=$1 local min=$2 local max=$3 - local disable_error=${disable_error:-0} + [[ $disable_error == 1 ]] || local disable_error=0 if [[ $input =~ ^-?[0-9]+$ ]]; then From 668d50df74e06b173afe8b5b5276d6c264d3606a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 20 Mar 2019 17:10:44 +0100 Subject: [PATCH 216/232] v6.22 + DietPi-Banner | Further code simplifications and consistency --- dietpi/func/dietpi-banner | 116 +++++++++++++++----------------------- 1 file changed, 45 insertions(+), 71 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index a435d90771..64f0cf30cf 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -18,12 +18,10 @@ #//////////////////////////////////// # Import DietPi-Globals -------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Banner' - G_INIT + # Do in main menu and on demand # Import DietPi-Globals -------------------------------------------------------------- - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 + [[ $1 == [012] ]] && INPUT=$1 || INPUT=0 #///////////////////////////////////////////////////////////////////////////////////// # Globals @@ -33,37 +31,24 @@ aDESCRIPTION=( 'Device model' + 'Uptime' 'CPU temp' + 'Hostname' + 'Domain name' 'LAN IP' 'WAN IP' 'Freespace (RootFS)' 'Freespace (DietPi userdata)' - 'Display DietPi useful commands?' - 'Hostname' - 'Domain name' 'Weather (wttr.in)' - 'Uptime' - - ) - aOBTAIN=( - - 'sed -n 3p /DietPi/dietpi/.network' #0: 'Active IP adapter' - 'sed -n 4p /DietPi/dietpi/.network' #1: 'LAN IP address' - 'wget -q -O- --timeout=2 --tries=1 https://dietpi.com/myip.php' #2: 'WAN IP address' # Move this to /DietPi/dietpi/.network? - 'hostname' #3: Hostname - 'domainname' #4: Domain name - 'curl -sL wttr.in/?format=4' #5: Weather - 'uptime -p' #6: Uptime + 'Display DietPi useful commands?' ) # Set defaults - aENABLED=(1 1 1 0 0 0 1 0 0 0 0) + aENABLED=(1 0 1 0 0 1 0 0 0 0 1) GREEN_LINE=' \e[38;5;154m─────────────────────────────────────────────────────\e[0m' - # Whole output string - #STRING_BANNER='' - + . /DietPi/dietpi/.version DIETPI_VERSION="$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC" [[ $G_GITBRANCH != 'master' ]] && DIETPI_VERSION+=" ($G_GITBRANCH)" @@ -87,7 +72,7 @@ > $FP_SAVEFILE - for i in ${!aENABLED[@]} + for i in ${!aDESCRIPTION[@]} do echo "aENABLED[$i]=${aENABLED[$i]}" >> $FP_SAVEFILE @@ -119,8 +104,7 @@ fi - echo -e "\ -$GREEN_LINE + echo -e "$GREEN_LINE \e[1mDietPi v$DIETPI_VERSION\e[0m \e[90m| $text_update_available_date\e[0m $GREEN_LINE" @@ -128,90 +112,85 @@ $GREEN_LINE" Print_Credits(){ - echo -e '\e[90m DietPi Team : MichaIng (lead), Daniel Knight (founder)\e[0m' - - local fp_prep_info='/DietPi/dietpi/.prep_info' - if [[ -f $fp_prep_info ]]; then + echo -e ' \e[90mDietPi Team : MichaIng (lead), Daniel Knight (founder)' - local image_creator=$(sed -n 1p $fp_prep_info) - local preimage_name=$(sed -n 2p $fp_prep_info) - [[ $image_creator == '0' ]] && image_creator='DietPi Core Team' + [[ -f /DietPi/dietpi/.prep_info ]] && mawk 'NR==1 {sub(/^0$/,"DietPi Core Team");a=$0} NR==2 {print " Image : "a" (pre-image: "$0")"}' /DietPi/dietpi/.prep_info - echo -e "\e[90m Image : $image_creator (pre-image: $preimage_name)\e[0m" - - fi - - echo -e '\e[90m Web : https://DietPi.com | https://twitter.com/dietpi_ + echo ' Web : https://DietPi.com | https://twitter.com/dietpi_ Patreon Legends : PINE64 community Donate : https://DietPi.com/#donate' local image_additional_credits=$(sed -n 8p /DietPi/dietpi/.hw_model) - [[ $image_additional_credits ]] && echo -e "\n\ Device image possible thanks to: $image_additional_credits" + [[ $image_additional_credits ]] && echo " Device image possible thanks to: $image_additional_credits" - echo -e ' DietPi Hosting : Powered by https://MyVirtualServer.com\e[0m' + echo -e ' DietPi Hosting : Powered by https://MyVirtualServer.com\e[0m\n' # Update available? if (( $UPDATE_AVAILABLE )); then if [[ $UPDATE_AVAILABLE_VERSION = '-1' ]]; then - echo -e '\n\e[1;31m Updated DietPi image is available, please download it:\e[0m\n https://dietpi.com/download\n' + echo -e ' \e[1;31mUpdated DietPi image is available, please download it:\e[0m\n https://dietpi.com/#download\n' else - echo -e "\e[1m dietpi-update\e[0m = \e[1;31mRun now to update DietPi (from v$DIETPI_VERSION to v$UPDATE_AVAILABLE_VERSION).\e[0m" + echo -e " \e[1mdietpi-update\e[0m = \e[1;31mRun now to update DietPi (from v$DIETPI_VERSION to v$UPDATE_AVAILABLE_VERSION).\e[0m" fi fi - echo '' - } Print_Useful_Commands(){ echo -e '\e[1m dietpi-launcher\e[0m = All the DietPi programs in one place. -\e[1m dietpi-config\e[0m = Feature rich configuration tool for your device. -\e[1m dietpi-software\e[0m = Select optimized software for installation. -\e[1m htop\e[0m = Resource monitor. -\e[1m cpu\e[0m = Shows CPU information and stats.\n' + \e[1mdietpi-config\e[0m = Feature rich configuration tool for your device. + \e[1mdietpi-software\e[0m = Select optimized software for installation. + \e[1mhtop\e[0m = Resource monitor. + \e[1mcpu\e[0m = Shows CPU information and stats.\n' } Print_Banner(){ - local green_bullet='\e[38;5;154m -\e[0m' + local green_bullet=' \e[38;5;154m-\e[0m' - # - Re-obtain network details if not already done. - [[ -f /DietPi/dietpi/.network ]] || /DietPi/dietpi/func/obtain_network_details + # - Source DietPi-Globals if CPU temp chosen + [[ ${aENABLED[2]} != 1 || $G_PROGRAM_NAME ]] || . /DietPi/dietpi/func/dietpi-globals - local index=0 - index=0; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m" - index=10; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[6]})\e[0m" - index=1; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP)\e[0m" - index=7; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[3]})\e[0m" - index=8; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[4]})\e[0m" - index=2; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[1]}) ($(${aOBTAIN[0]}))\e[0m" - index=3; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[2]})\e[0m" + # - Re-obtain network details if missing and LAN IP chosen + [[ ${aENABLED[5]} != 1 || -f /DietPi/dietpi/.network ]] || /DietPi/dietpi/func/obtain_network_details - index=4; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /)\e[0m" - index=5; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(info_autoscale=1 G_CHECK_FREESPACE /mnt/dietpi_userdata)\e[0m" - - index=9; (( ${aENABLED[$index]} )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[$index]} \e[90m| $(${aOBTAIN[5]})\e[0m" + printf '\ec' # clear current terminal screen + Print_Header + (( ${aENABLED[0]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[0]} \e[90m| $(mawk 'NR==2 {print $0}' /DietPi/dietpi/.hw_model 2>&1)\e[0m" #0: Device model + (( ${aENABLED[1]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[1]} \e[90m| $(uptime -p 2>&1)\e[0m" #1: Uptime + (( ${aENABLED[2]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[2]} \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP 2>&1)\e[0m" #2: CPU temp + (( ${aENABLED[3]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[3]} \e[90m| $(hostname 2>&1)\e[0m" #3: Hostname + (( ${aENABLED[4]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[4]} \e[90m| $(domainname 2>&1)\e[0m" #4: Domain name + (( ${aENABLED[5]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[5]} \e[90m| $(mawk 'NR==3 {dev=$0} NR==4 {print $0" ("dev")"}' /DietPi/dietpi/.network 2>&1)\e[0m" #5: LAN IP (adapter) + (( ${aENABLED[6]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[6]} \e[90m| $(curl -sLm 2 https://dietpi.com/myip.php 2>&1)\e[0m" #6: WAN IP # Move this to /DietPi/dietpi/.network? + (( ${aENABLED[7]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[7]} \e[90m| $(df -h --output=avail / | mawk 'NR==2 {print $1}' 2>&1)\e[0m" #7: Freespace (RootFS) + (( ${aENABLED[8]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[8]} \e[90m| $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)\e[0m" #8: Freespace (DietPi userdata) + (( ${aENABLED[9]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[9]} \e[90m| $(curl -sLm 2 https://wttr.in/?format=4 2>&1)\e[0m" #9: Weather echo -e "$GREEN_LINE\n" Print_Credits - index=6; (( ${aENABLED[$index]} )) && Print_Useful_Commands + (( ${aENABLED[10]} == 1 )) && Print_Useful_Commands } Menu_Main(){ + . /DietPi/dietpi/func/dietpi-globals + G_PROGRAM_NAME='DietPi-Banner' + G_INIT + G_WHIP_CHECKLIST_ARRAY=() - for i in ${!aENABLED[@]} + for i in ${!aDESCRIPTION[@]} do local state='off' @@ -222,7 +201,7 @@ $GREEN_LINE" if G_WHIP_CHECKLIST "Please select options to enable in $G_PROGRAM_NAME display:"; then - for i in ${!aENABLED[@]} + for i in ${!aDESCRIPTION[@]} do aENABLED[$i]=0 @@ -252,18 +231,13 @@ $GREEN_LINE" elif (( $INPUT == 1 )); then - printf '\ec' # clear current terminal screen Load - Print_Header Print_Banner elif (( $INPUT == 2 )); then Load Menu_Main - - printf '\ec' # clear current terminal screen - Print_Header Print_Banner fi From 2225fb6eee26177725dbd766424c24ce68d22cda Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 20 Mar 2019 22:27:52 +0100 Subject: [PATCH 217/232] v6.22 + DietPi-Banner | Allow custom banner entry --- dietpi/func/dietpi-banner | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 64f0cf30cf..04922b3269 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -27,6 +27,7 @@ # Globals #///////////////////////////////////////////////////////////////////////////////////// FP_SAVEFILE='/DietPi/dietpi/.dietpi-banner' + FP_CUSTOM='/DietPi/dietpi/.dietpi-banner_custom' aDESCRIPTION=( @@ -40,11 +41,12 @@ 'Freespace (RootFS)' 'Freespace (DietPi userdata)' 'Weather (wttr.in)' + 'Custom banner entry' 'Display DietPi useful commands?' ) # Set defaults - aENABLED=(1 0 1 0 0 1 0 0 0 0 1) + aENABLED=(1 0 1 0 0 1 0 0 0 0 0 1) GREEN_LINE=' \e[38;5;154m─────────────────────────────────────────────────────\e[0m' @@ -79,6 +81,9 @@ done + # Safe custom entry description + echo "aDESCRIPTION[10]='${aDESCRIPTION[10]}'" >> $FP_SAVEFILE + } Print_Header(){ @@ -175,10 +180,11 @@ $GREEN_LINE" (( ${aENABLED[7]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[7]} \e[90m| $(df -h --output=avail / | mawk 'NR==2 {print $1}' 2>&1)\e[0m" #7: Freespace (RootFS) (( ${aENABLED[8]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[8]} \e[90m| $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)\e[0m" #8: Freespace (DietPi userdata) (( ${aENABLED[9]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[9]} \e[90m| $(curl -sLm 2 https://wttr.in/?format=4 2>&1)\e[0m" #9: Weather + (( ${aENABLED[10]} == 1 )) && [[ -x $FP_CUSTOM ]] && echo -e "$green_bullet \e[1m${aDESCRIPTION[10]} \e[90m| $(bash $FP_CUSTOM 2>&1)\e[0m" #10: Custom echo -e "$GREEN_LINE\n" Print_Credits - (( ${aENABLED[10]} == 1 )) && Print_Useful_Commands + (( ${aENABLED[11]} == 1 )) && Print_Useful_Commands } @@ -212,6 +218,27 @@ $GREEN_LINE" do aENABLED[$i]=1 + # Custom entry + if (( $i == 10 )); then + + [[ -f $FP_CUSTOM ]] && G_WHIP_DEFAULT_ITEM=$(<$FP_CUSTOM) || G_WHIP_DEFAULT_ITEM="echo 'Hello World!'" + if G_WHIP_INPUTBOX 'You have chosen to show a custom entry in the banner. +Please enter/verify the desired command here.\n +NB: It is executed as bash script, so it needs to be in bash compatible syntax. + For complex or non-bash scripts keep it separate and add its execution command here.'; then + + echo "$G_WHIP_RETURNED_VALUE" > $FP_CUSTOM + chmod +x $FP_CUSTOM + + G_WHIP_DEFAULT_ITEM=${aDESCRIPTION[10]} + G_WHIP_INPUTBOX 'Please enter a meaningful name/description to be shown in front of your custom command output:' && aDESCRIPTION[10]=$G_WHIP_RETURNED_VALUE + + fi + + # Disable custom entry if file was not created, e.g. cancelled by user + [[ -f $FP_CUSTOM ]] || aENABLED[10]=0 + + fi done From 12bbd3164cc52de6dd6fb24b0a751d884864e9b6 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 21 Mar 2019 01:58:14 +0100 Subject: [PATCH 218/232] v6.22 + DietPi-PreBoot | Moved Fire3 TTY2 workaround into PreBoot + tiny coding/wording --- dietpi/preboot | 53 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/dietpi/preboot b/dietpi/preboot index 089a1bb280..732f628f31 100644 --- a/dietpi/preboot +++ b/dietpi/preboot @@ -13,15 +13,15 @@ # - activates on boot from dietpi-preboot.service, runs before dietpi-boot.service and networking #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- /DietPi/dietpi/func/dietpi-obtain_hw_model # Runs every boot to allow e.g. switching SDcards between devices and to be failsafe . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-PreBoot' G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// - #Globals + # Globals #///////////////////////////////////////////////////////////////////////////////////// RPi_Set_Clock_Speeds(){ @@ -29,7 +29,7 @@ # If no manual overclock settings have been applied by user, set non/safe overclocking values as commented defaults if ! grep -qE '^[[:blank:]]*(over_voltage|(arm|core|gpu|sdram)_freq)=' /DietPi/config.txt; then - #Zero + # Zero if [[ ${G_HW_MODEL_DESCRIPTION,,} == *'zero'* ]]; then sed -i '/over_voltage=/c\#over_voltage=0' /DietPi/config.txt @@ -37,7 +37,7 @@ sed -i '/core_freq=/c\#core_freq=400' /DietPi/config.txt sed -i '/sdram_freq=/c\#sdram_freq=450' /DietPi/config.txt - #RPi v1 - Apply safe overclock mode + # RPi v1 - Apply safe overclock mode elif (( $G_HW_MODEL < 2 )); then G_CONFIG_INJECT 'over_voltage=' 'over_voltage=2' /DietPi/config.txt @@ -45,7 +45,7 @@ sed -i '/core_freq=/c\#core_freq=250' /DietPi/config.txt sed -i '/sdram_freq=/c\#sdram_freq=400' /DietPi/config.txt - #RPi v2 + # RPi v2 elif (( $G_HW_MODEL == 2 )); then sed -i '/over_voltage=/c\#over_voltage=0' /DietPi/config.txt @@ -53,7 +53,7 @@ sed -i '/core_freq=/c\#core_freq=250' /DietPi/config.txt sed -i '/sdram_freq=/c\#sdram_freq=450' /DietPi/config.txt - #RPi v3 B+ + # RPi v3 B+ elif [[ ${G_HW_MODEL_DESCRIPTION,,} == *'rpi 3 model b+'* ]]; then sed -i '/over_voltage=/c\#over_voltage=0' /DietPi/config.txt @@ -62,7 +62,7 @@ sed -i '/arm_freq=/c\#arm_freq=1400' /DietPi/config.txt sed -i '/sdram_freq=/c\#sdram_freq=500' /DietPi/config.txt - #RPi v3 + # RPi v3 elif (( $G_HW_MODEL == 3 )); then sed -i '/over_voltage=/c\#over_voltage=0' /DietPi/config.txt @@ -80,13 +80,13 @@ Apply_DietPi_FirstRun_Settings(){ #---------------------------------------------------------------- - #Automation + # Automation #---------------------------------------------------------------- # - Generate Swapfile /DietPi/dietpi/func/dietpi-set_dphys-swapfile $(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') "$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')" # - Apply Timezone - local autoinstall_timezone=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_TIMEZONE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//' ) + local autoinstall_timezone=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_TIMEZONE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') if [[ $autoinstall_timezone != $( /dev/null && amixer set PCM -- -010 #----------------------------------------------------------------------------------- - #First run prep + # First run prep if (( $G_DIETPI_INSTALL_STAGE == -1 )); then + #---------------------------------------------------------------- + # Workarounds + # - Workaround for NanoPi Fire3 with tty1 disabled: https://github.com/MichaIng/DietPi/issues/2225 + if (( $G_HW_MODEL == 62 )) && dmesg | grep -qi 'NanoPi Fire3'; then + + chvt 2 + echo -e '#!/bin/dash\chvt 2' /var/lib/dietpi/postboot.d/fire3_tty2 + + fi + #---------------------------------------------------------------- + # - Set RPi v1 safe overclocking profile (900MHz) and apply commented defaults based on RPi model (( $G_HW_MODEL < 10 )) && RPi_Set_Clock_Speeds @@ -274,15 +285,15 @@ G_DIETPI-NOTIFY 2 'Running custom script, please wait...' - local fp_dietpiautomation_custom_prescript_log='/var/tmp/dietpi/logs/dietpi-automation_custom_prescript.log' + local fp_log='/var/tmp/dietpi/logs/dietpi-automation_custom_prescript.log' chmod +x /boot/Automation_Custom_PreScript.sh - if /boot/Automation_Custom_PreScript.sh | tee $fp_dietpiautomation_custom_prescript_log; then + if /boot/Automation_Custom_PreScript.sh | tee $fp_log; then G_DIETPI-NOTIFY 0 'Custom script' else - G_DIETPI-NOTIFY 1 "Custom script: Please see the log file for more information $fp_dietpiautomation_custom_prescript_log" + G_DIETPI-NOTIFY 1 "Custom script: Please see the log file for more information $fp_log" fi From 5b0a74b77a4b2daf963efa1fef47ea0a0a8dc3cc Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 21 Mar 2019 02:00:38 +0100 Subject: [PATCH 219/232] v6.22 + DietPi-PreBoot | Moved applying install stage on first boot into PreBoot, since no first run steps are done in DietPi-Boot anymore --- dietpi/preboot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dietpi/preboot b/dietpi/preboot index 732f628f31..e4c2a4a010 100644 --- a/dietpi/preboot +++ b/dietpi/preboot @@ -302,6 +302,9 @@ # - Activate DietPi Boot Loader User Settings and bring up network (dietpi.txt) Apply_DietPi_FirstRun_Settings + # - Set Install stage index to trigger DietPi-Update 1st run on login + echo 0 > /DietPi/dietpi/.install_stage + fi #----------------------------------------------------------------------------------- G_THREAD_WAIT From c88095f7037b5c657b8c1a6375c10d9ee5c97917 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 21 Mar 2019 02:05:03 +0100 Subject: [PATCH 220/232] v6.22 + DietPi-Boot | NanoPi Fire3 TTY2 workaround has been moved into DietPi-PreBoot; Moved applying install stage on first boot as well, since no first run steps are left anymore --- dietpi/boot | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/dietpi/boot b/dietpi/boot index 2120222beb..d2ddd649dc 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -23,24 +23,6 @@ # Globals #///////////////////////////////////////////////////////////////////////////////////// - Apply_DietPi_FirstRun_Settings(){ - - #---------------------------------------------------------------- - # Workarounds - # - Workaround for NanoPi Fire3 with tty1 disabled: https://github.com/MichaIng/DietPi/issues/2225 - if (( $G_HW_MODEL == 62 )) && dmesg | grep -qi 'NanoPi Fire3'; then - - chvt 2 - cat << _EOF_ > /var/lib/dietpi/postboot.d/fire3_tty2 -#!/bin/bash -chvt 2 -_EOF_ - - fi - #---------------------------------------------------------------- - - } - Wait_For_Valid_Network_Connection(){ # Wait mode, max time @@ -52,7 +34,7 @@ _EOF_ while (( $loop_count <= $max_loops )) do - G_DIETPI-NOTIFY 2 "$(date) | Waiting for valid network connection, before continuing boot | Mode=$boot_wait_for_network" + G_DIETPI-NOTIFY 2 "$(date) | Waiting for valid network connection before continuing boot | Mode=$boot_wait_for_network" if [[ $(ip r) =~ ' via ' ]]; then @@ -140,21 +122,8 @@ _EOF_ fi # Normal boot - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - - # - Run time sync - /DietPi/dietpi/func/run_ntpd 1 &> /dev/null & - - # First run prep - elif (( $G_DIETPI_INSTALL_STAGE == -1 )); then - - # - Activate and apply any 1st run settings - Apply_DietPi_FirstRun_Settings - - # - Set Install stage index to trigger DietPi-Update 1st run on login - echo 0 > /DietPi/dietpi/.install_stage - - fi + # - Run time sync + (( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/func/run_ntpd 1 &> /dev/null & #----------------------------------------------------------------------------------- exit From 33669ef9d190870f46c0dfd02a047a715869b24a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 21 Mar 2019 02:36:49 +0100 Subject: [PATCH 221/232] v6.22 + DietPi-Patch | Skip single /dietpi/conf/ file removal on v6.18 => v6.19 since we remove the whole dir on v6.19 => v6.20 + DietPi-Patch | v6.22 patch: Fix wrong mpd.conf path and wrong user data global variable call + DietPi-Patch | Minor coding --- dietpi/patch_file | 68 ++++++----------------------------------------- 1 file changed, 8 insertions(+), 60 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 5f99aab7a1..77341a58c0 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1144,10 +1144,9 @@ _EOF_ chmod 777 /var/tmp #------------------------------------------------------------------------------- #Remove obsolete EMR patch file and redo removal of obsolete script files, as they were not removed from disk: https://github.com/MichaIng/DietPi/pull/2123#issuecomment-428121908 - for i in /DietPi/dietpi /boot/dietpi + for i in /{DietPi,boot}/dietpi do - [[ -f $i/conf/deluge.service ]] && rm $i/conf/deluge.service [[ -f $i/dietpi-obtain_hw_model ]] && rm $i/dietpi-obtain_hw_model [[ -f $i/dietpi-cpu_set ]] && rm $i/dietpi-cpu_set [[ -f $i/.patch_emr ]] && rm $i/.patch_emr @@ -1184,10 +1183,7 @@ _EOF_ if (( $G_HW_MODEL == 62 )) && dmesg | grep -qi 'NanoPi Fire3'; then chvt 2 - cat << _EOF_ > /var/lib/dietpi/postboot.d/fire3_tty2 -#!/bin/bash -chvt 2 -_EOF_ + echo -e '#!/bin/dash\chvt 2' /var/lib/dietpi/postboot.d/fire3_tty2 fi #------------------------------------------------------------------------------- @@ -1228,49 +1224,6 @@ You will not face any practical differences, since both services start the same elif (( $G_DIETPI_VERSION_SUB == 18 )); then - #------------------------------------------------------------------------------- - #conf moved to github - local afp_config_remove=( - - 'smb.conf' - 'vsftpd.conf' - 'xorg_c1.conf' - 'xorg_c2.conf' - 'xorg_xu4.conf' - 'raspimjpeg.service' - 'proftpd.conf' - 'phpsysinfo.ini' - 'opentyrian_run' - 'openbazaar-server.service' #Not actually used in dps... - 'kodi_udev' - 'haproxy_init' - 'nginx.sites-dietpi.pydio.config' - 'nginx.sites-dietpi.owncloud.config' - 'nginx.sites-dietpi.nextcloud.config' - 'nginx.site-available-default' - 'nginx.conf' - 'minidlna.conf' - 'lighttpd.pydio.conf' - 'apache.pydio.conf' - 'lighttpd.nextcloud.conf' - 'deluge_web.conf' - 'deluge.conf' - 'apache.ownnextcloud.conf' - 'apache2_jessie.conf' - 'squeezelite.service' - 'roonbridge.service' - 'netdata.service' - - ) - - for i in "${!afp_config_remove[@]}" - do - - rm -f /{DietPi,boot}/dietpi/conf/${afp_config_remove[$i]} - - done - - unset afp_config_remove #------------------------------------------------------------------------------- #conf renaming: https://github.com/MichaIng/DietPi/pull/2312/files # - Apache @@ -1604,9 +1557,9 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi #------------------------------------------------------------------------------- #MPD: Fix permissions issue: https://github.com/MichaIng/DietPi/issues/2462 - if [[ -f /etc/mpd/mpd.conf ]]; then + if [[ -f /etc/mpd.conf ]]; then - sed -Ei '/^(user|group)[[:blank:]]/d' /etc/mpd/mpd.conf + sed -Ei '/^(user|group)[[:blank:]]/d' /etc/mpd.conf sed -i '/^Group=/d' /lib/systemd/system/mpd.service G_CONFIG_INJECT 'User=' 'User=mpd' /lib/systemd/system/mpd.service '\[Service\]' G_CONFIG_INJECT 'PermissionsStartOnly=' 'PermissionsStartOnly=true' /lib/systemd/system/mpd.service '^User=mpd' @@ -1651,15 +1604,10 @@ _EOF_ [[ -f /var/log/dietpi-sync.log ]] && rm /var/log/dietpi-sync.log #------------------------------------------------------------------------------- #XU4, use Meveric's xorg.conf which detects 3.x and 4.x kernel configuration requirments: - if (( $G_HW_MODEL == 11 )); then - - local fp_file='/etc/X11/xorg.conf' - if [[ -f $fp_file ]]; then #already installed + if (( $G_HW_MODEL == 11 )) && [[ -f /etc/X11/xorg.conf ]]; then - rm $fp_file - G_AGI --reinstall firmware-samsung xf86-video-armsoc-odroid malit628-odroid - - fi + rm /etc/X11/xorg.conf + G_AGI --reinstall firmware-samsung xf86-video-armsoc-odroid malit628-odroid fi #------------------------------------------------------------------------------- @@ -1733,7 +1681,7 @@ Redirect permanent /ocs-provider /nextcloud/ocs-provider' >> /etc/apache2/sites- reinstall_indices+=' 45' G_AGP deluge-webui - [[ -e ~deluge ]] && mv ~deluge $G_DIETPI_USERDATA/deluge_home_backup + [[ -e ~deluge ]] && mv ~deluge $G_FP_DIETPI_USERDATA/deluge_home_backup userdel -rf deluge rm -Rf /{root,home/*}/.config/deluge mkdir -p /var/log/deluged From fe001fcf8e9e2b4fa24f848f51b61fab051b6feb Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 21 Mar 2019 03:33:48 +0100 Subject: [PATCH 222/232] v6.22 + DietPi-Globals | Tiny coding/reorder + default RC version update --- dietpi/func/dietpi-globals | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 9be89a77fd..5c32b13a1f 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -60,12 +60,12 @@ [[ -f '/DietPi/dietpi/.install_stage' ]] && G_DIETPI_INSTALL_STAGE=$( Date: Thu, 21 Mar 2019 20:04:59 +0100 Subject: [PATCH 223/232] v6.22 + DietPi-PreBoot | Syntax --- dietpi/preboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/preboot b/dietpi/preboot index e4c2a4a010..0886283a8c 100644 --- a/dietpi/preboot +++ b/dietpi/preboot @@ -272,7 +272,7 @@ if (( $G_HW_MODEL == 62 )) && dmesg | grep -qi 'NanoPi Fire3'; then chvt 2 - echo -e '#!/bin/dash\chvt 2' /var/lib/dietpi/postboot.d/fire3_tty2 + echo -e '#!/bin/dash\nchvt 2' /var/lib/dietpi/postboot.d/fire3_tty2 fi #---------------------------------------------------------------- From ffe7c16bd7f9c9f6c768d64b02b2d88cb58f2a3c Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 21 Mar 2019 20:05:42 +0100 Subject: [PATCH 224/232] v6.22 + DietPi-Patch | Syntax --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 77341a58c0..6e3e6b43ea 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1183,7 +1183,7 @@ _EOF_ if (( $G_HW_MODEL == 62 )) && dmesg | grep -qi 'NanoPi Fire3'; then chvt 2 - echo -e '#!/bin/dash\chvt 2' /var/lib/dietpi/postboot.d/fire3_tty2 + echo -e '#!/bin/dash\nchvt 2' /var/lib/dietpi/postboot.d/fire3_tty2 fi #------------------------------------------------------------------------------- From 22b74314496fabe3b035aa20a8318505dd2b8079 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 21 Mar 2019 20:57:37 +0100 Subject: [PATCH 225/232] v6.22 + DietPi-Banner | Make FQDN and NIS differentiation clearer --- dietpi/func/dietpi-banner | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 04922b3269..3415df14f3 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -34,12 +34,12 @@ 'Device model' 'Uptime' 'CPU temp' - 'Hostname' - 'Domain name' + 'FQDN/hostname' + 'NIS domainname' 'LAN IP' 'WAN IP' 'Freespace (RootFS)' - 'Freespace (DietPi userdata)' + 'Freespace (userdata)' 'Weather (wttr.in)' 'Custom banner entry' 'Display DietPi useful commands?' @@ -173,8 +173,8 @@ $GREEN_LINE" (( ${aENABLED[0]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[0]} \e[90m| $(mawk 'NR==2 {print $0}' /DietPi/dietpi/.hw_model 2>&1)\e[0m" #0: Device model (( ${aENABLED[1]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[1]} \e[90m| $(uptime -p 2>&1)\e[0m" #1: Uptime (( ${aENABLED[2]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[2]} \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP 2>&1)\e[0m" #2: CPU temp - (( ${aENABLED[3]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[3]} \e[90m| $(hostname 2>&1)\e[0m" #3: Hostname - (( ${aENABLED[4]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[4]} \e[90m| $(domainname 2>&1)\e[0m" #4: Domain name + (( ${aENABLED[3]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[3]} \e[90m| $(hostname -f 2>&1)\e[0m" #3: Hostname + (( ${aENABLED[4]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[4]} \e[90m| $(hostname -y 2>&1)\e[0m" #4: Domain name (( ${aENABLED[5]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[5]} \e[90m| $(mawk 'NR==3 {dev=$0} NR==4 {print $0" ("dev")"}' /DietPi/dietpi/.network 2>&1)\e[0m" #5: LAN IP (adapter) (( ${aENABLED[6]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[6]} \e[90m| $(curl -sLm 2 https://dietpi.com/myip.php 2>&1)\e[0m" #6: WAN IP # Move this to /DietPi/dietpi/.network? (( ${aENABLED[7]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[7]} \e[90m| $(df -h --output=avail / | mawk 'NR==2 {print $1}' 2>&1)\e[0m" #7: Freespace (RootFS) From 9490218f6758067b82e3fc1ecbb72e43522da3ee Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 21 Mar 2019 23:58:10 +0100 Subject: [PATCH 226/232] v6.22 + DietPi-Patch | Syntax --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 6e3e6b43ea..adb1a75208 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1183,7 +1183,7 @@ _EOF_ if (( $G_HW_MODEL == 62 )) && dmesg | grep -qi 'NanoPi Fire3'; then chvt 2 - echo -e '#!/bin/dash\nchvt 2' /var/lib/dietpi/postboot.d/fire3_tty2 + echo -e '#!/bin/dash\nchvt 2' > /var/lib/dietpi/postboot.d/fire3_tty2 fi #------------------------------------------------------------------------------- From fe434afa434fa8862b9a5aec71fd7f3a42863122 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 21 Mar 2019 23:59:02 +0100 Subject: [PATCH 227/232] v6.22 + DietPi-PreBoot | Syntax --- dietpi/preboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/preboot b/dietpi/preboot index 0886283a8c..718a35db10 100644 --- a/dietpi/preboot +++ b/dietpi/preboot @@ -272,7 +272,7 @@ if (( $G_HW_MODEL == 62 )) && dmesg | grep -qi 'NanoPi Fire3'; then chvt 2 - echo -e '#!/bin/dash\nchvt 2' /var/lib/dietpi/postboot.d/fire3_tty2 + echo -e '#!/bin/dash\nchvt 2' > /var/lib/dietpi/postboot.d/fire3_tty2 fi #---------------------------------------------------------------- From 3dbaf42a400e15522436658cb70142e0afff18d0 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 22 Mar 2019 00:19:44 +0100 Subject: [PATCH 228/232] v6.22 + CHANGELOG | Add current known C2 and XU4 issues --- CHANGELOG.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2debe6867a..3f3fb9afb5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -56,6 +56,8 @@ Known/Outstanding Issues: - DietPi-Drive_Manager | encryptfs is currently not supported and will be removed from fstab when executing drive manager: https://github.com/MichaIng/DietPi/issues/2078 - RPi | LXAppearance (on LXDE desktop) hangs on dbus-launch: https://github.com/MichaIng/DietPi/issues/1791 - Odroid C2 | Some WiFi adapters do no work as hotspot: https://github.com/MichaIng/DietPi/issues/1955 +- Odroid XU4 | Kodi freezes shortly on video playback: https://github.com/MichaIng/DietPi/issues/2584 +- Rock64 | 3.5mm A/V jack is currently not functional: https://github.com/MichaIng/DietPi/issues/2522 - DietPi-Software | Node-RED: Pre-installed modules cannot be updated via web UI: https://github.com/MichaIng/DietPi/issues/2073 - DietPi-Software | Raspimjpeg: With Lighttpd, streaming mjpeg does not work: https://github.com/MichaIng/DietPi/issues/1747 From 28f2c252270e6a0ef0de0dcc4b3789599d6a911e Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 22 Mar 2019 13:43:18 +0000 Subject: [PATCH 229/232] v6.22 - DietPi-Software | Allo GUI: Updated to version 13. Provides for view the USB status and sound card status on Dietpi Allo web GUI system status page. Many thanks to @sudeep!: https://github.com/sparky-sbc/sparky-test/tree/master/dietpi-gui-usbdebug --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 4 ++-- dietpi/patch_file | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2debe6867a..a81b6419ff 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -24,6 +24,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | rTorrent: Runs now as user "rtorrent" and creates files as group "dietpi" with 775/664 permissions. Enabled Buster support and enhanced config file handling on reinstall: https://github.com/MichaIng/DietPi/pull/2633 - DietPi-Software | Plex Media Server: Now installs the latest version automatically (currently 1.15) which as well includes official ARM binaries. Many thanks to @WolfganP for informing us about this new release: https://github.com/MichaIng/DietPi/issues/2553 - DietPi-Software | Nextcloud: Resolved an admin panel warning about missing ocm/ocs-provider redirects. Many thanks to @minnux for reporting this issue: https://github.com/MichaIng/DietPi/issues/2638 +- DietPi-Software | Allo GUI: Updated to version 13. Provides for view the USB status and sound card status on Dietpi Allo web GUI system status page. Many thanks to @sudeep!: https://github.com/sparky-sbc/sparky-test/tree/master/dietpi-gui-usbdebug Bug Fixes: - System | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2529 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index da3faaded0..68c0204fbf 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6147,7 +6147,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix ${aSOFTWARE_INSTALL_STATE[160]} == 1 )); then Banner_Installing - Download_Install 'https://dietpi.com/downloads/binaries/all/allo_web_interface_v12.7z' /var/www + Download_Install 'https://dietpi.com/downloads/binaries/all/allo_web_interface_v13.7z' /var/www fi @@ -10990,7 +10990,7 @@ SCGIMount /RPC2 127.0.0.1:5000 _EOF_ a2ensite dietpi-rutorrent - + # - Lighttpd elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )); then diff --git a/dietpi/patch_file b/dietpi/patch_file index 5f99aab7a1..537b53a23c 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1711,11 +1711,12 @@ Redirect permanent /ocs-provider /nextcloud/ocs-provider' >> /etc/apache2/sites- #------------------------------------------------------------------------------- #Reinstalls # Amiberry 2.25: https://github.com/MichaIng/DietPi/issues/2599 + # Allo GUI v13: https://github.com/sparky-sbc/sparky-test/tree/master/dietpi-gui-usbdebug # Deluge: Patch according to installer rework: https://github.com/MichaIng/DietPi/pull/2594 # rTorrent: https://github.com/MichaIng/DietPi/issues/2629 if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - local reinstall_indices='108' + local reinstall_indices='108 160' if grep -q '^aSOFTWARE_INSTALL_STATE\[107\]=2' /DietPi/dietpi/.installed && [[ -f /root/.rtorrent.rc ]]; then From 889e2059473ea97d0672e70871135f0043c4c9fa Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Fri, 22 Mar 2019 14:17:03 +0000 Subject: [PATCH 230/232] v6.22 + Beta RC3 --- dietpi/server_version-6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index 8b58001294..467a39c6e9 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 22 -2 +3 From cd2c6eb50170465d11f6de340fedd963aff2d1d4 Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 22 Mar 2019 19:06:55 +0000 Subject: [PATCH 231/232] v6.22 (#2649) + DietPi-Banner | Support for custom colour codes --- dietpi/func/dietpi-banner | 75 ++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 3415df14f3..7f9d86e6ac 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -48,7 +48,19 @@ # Set defaults aENABLED=(1 0 1 0 0 1 0 0 0 0 0 1) - GREEN_LINE=' \e[38;5;154m─────────────────────────────────────────────────────\e[0m' + COLOUR_RESET='\e[0m' + aCOLOUR=( + + '\e[38;5;154m' # DietPi green | Lines, bullets and seperators + '\e[1m' # Bold white | Main descriptions + '\e[90m' # Grey | Credits + '\e[91m' # Red | Update notifications + + ) + + GREEN_LINE=" ${aCOLOUR[0]}─────────────────────────────────────────────────────$COLOUR_RESET" + GREEN_BULLET=" ${aCOLOUR[0]}-$COLOUR_RESET" + GREEN_SEPERATOR="${aCOLOUR[0]}:$COLOUR_RESET" . /DietPi/dietpi/.version DIETPI_VERSION="$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC" @@ -84,6 +96,13 @@ # Safe custom entry description echo "aDESCRIPTION[10]='${aDESCRIPTION[10]}'" >> $FP_SAVEFILE + for i in ${!aCOLOUR[@]} + do + + echo "aCOLOUR[$i]='${aCOLOUR[$i]}'" >> $FP_SAVEFILE + + done + } Print_Header(){ @@ -95,11 +114,11 @@ if [[ $UPDATE_AVAILABLE_VERSION == '-1' ]]; then - text_update_available_date='\e[1;33mImage available\e[0m' + text_update_available_date="${aCOLOUR[3]}Image available" else - text_update_available_date='\e[1;33mUpdate available\e[0m' + text_update_available_date="${aCOLOUR[3]}Update available" fi @@ -110,14 +129,14 @@ fi echo -e "$GREEN_LINE - \e[1mDietPi v$DIETPI_VERSION\e[0m \e[90m| $text_update_available_date\e[0m + ${aCOLOUR[1]}DietPi v$DIETPI_VERSION$COLOUR_RESET $GREEN_SEPERATOR $text_update_available_date$COLOUR_RESET $GREEN_LINE" } Print_Credits(){ - echo -e ' \e[90mDietPi Team : MichaIng (lead), Daniel Knight (founder)' + echo -e " ${aCOLOUR[2]}DietPi Team : MichaIng (lead), Daniel Knight (founder)" [[ -f /DietPi/dietpi/.prep_info ]] && mawk 'NR==1 {sub(/^0$/,"DietPi Core Team");a=$0} NR==2 {print " Image : "a" (pre-image: "$0")"}' /DietPi/dietpi/.prep_info @@ -128,18 +147,18 @@ $GREEN_LINE" local image_additional_credits=$(sed -n 8p /DietPi/dietpi/.hw_model) [[ $image_additional_credits ]] && echo " Device image possible thanks to: $image_additional_credits" - echo -e ' DietPi Hosting : Powered by https://MyVirtualServer.com\e[0m\n' + echo -e " DietPi Hosting : Powered by https://MyVirtualServer.com$COLOUR_RESET\n" # Update available? if (( $UPDATE_AVAILABLE )); then if [[ $UPDATE_AVAILABLE_VERSION = '-1' ]]; then - echo -e ' \e[1;31mUpdated DietPi image is available, please download it:\e[0m\n https://dietpi.com/#download\n' + echo -e " ${aCOLOUR[3]}Updated DietPi image is available, please download it:$COLOUR_RESET\n https://dietpi.com/#download\n" else - echo -e " \e[1mdietpi-update\e[0m = \e[1;31mRun now to update DietPi (from v$DIETPI_VERSION to v$UPDATE_AVAILABLE_VERSION).\e[0m" + echo -e " ${aCOLOUR[1]}dietpi-update$COLOUR_RESET $GREEN_SEPERATOR ${aCOLOUR[3]}Run now to update DietPi from v$DIETPI_VERSION to v$UPDATE_AVAILABLE_VERSION.$COLOUR_RESET\n" fi @@ -149,18 +168,16 @@ $GREEN_LINE" Print_Useful_Commands(){ - echo -e '\e[1m dietpi-launcher\e[0m = All the DietPi programs in one place. - \e[1mdietpi-config\e[0m = Feature rich configuration tool for your device. - \e[1mdietpi-software\e[0m = Select optimized software for installation. - \e[1mhtop\e[0m = Resource monitor. - \e[1mcpu\e[0m = Shows CPU information and stats.\n' + echo -e "${aCOLOUR[1]} dietpi-launcher$COLOUR_RESET $GREEN_SEPERATOR All the DietPi programs in one place. + ${aCOLOUR[1]}dietpi-config$COLOUR_RESET $GREEN_SEPERATOR Feature rich configuration tool for your device. + ${aCOLOUR[1]}dietpi-software$COLOUR_RESET $GREEN_SEPERATOR Select optimized software for installation. + ${aCOLOUR[1]}htop$COLOUR_RESET $GREEN_SEPERATOR Resource monitor. + ${aCOLOUR[1]}cpu$COLOUR_RESET $GREEN_SEPERATOR Shows CPU information and stats.\n" } Print_Banner(){ - local green_bullet=' \e[38;5;154m-\e[0m' - # - Source DietPi-Globals if CPU temp chosen [[ ${aENABLED[2]} != 1 || $G_PROGRAM_NAME ]] || . /DietPi/dietpi/func/dietpi-globals @@ -170,17 +187,17 @@ $GREEN_LINE" printf '\ec' # clear current terminal screen Print_Header - (( ${aENABLED[0]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[0]} \e[90m| $(mawk 'NR==2 {print $0}' /DietPi/dietpi/.hw_model 2>&1)\e[0m" #0: Device model - (( ${aENABLED[1]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[1]} \e[90m| $(uptime -p 2>&1)\e[0m" #1: Uptime - (( ${aENABLED[2]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[2]} \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP 2>&1)\e[0m" #2: CPU temp - (( ${aENABLED[3]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[3]} \e[90m| $(hostname -f 2>&1)\e[0m" #3: Hostname - (( ${aENABLED[4]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[4]} \e[90m| $(hostname -y 2>&1)\e[0m" #4: Domain name - (( ${aENABLED[5]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[5]} \e[90m| $(mawk 'NR==3 {dev=$0} NR==4 {print $0" ("dev")"}' /DietPi/dietpi/.network 2>&1)\e[0m" #5: LAN IP (adapter) - (( ${aENABLED[6]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[6]} \e[90m| $(curl -sLm 2 https://dietpi.com/myip.php 2>&1)\e[0m" #6: WAN IP # Move this to /DietPi/dietpi/.network? - (( ${aENABLED[7]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[7]} \e[90m| $(df -h --output=avail / | mawk 'NR==2 {print $1}' 2>&1)\e[0m" #7: Freespace (RootFS) - (( ${aENABLED[8]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[8]} \e[90m| $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)\e[0m" #8: Freespace (DietPi userdata) - (( ${aENABLED[9]} == 1 )) && echo -e "$green_bullet \e[1m${aDESCRIPTION[9]} \e[90m| $(curl -sLm 2 https://wttr.in/?format=4 2>&1)\e[0m" #9: Weather - (( ${aENABLED[10]} == 1 )) && [[ -x $FP_CUSTOM ]] && echo -e "$green_bullet \e[1m${aDESCRIPTION[10]} \e[90m| $(bash $FP_CUSTOM 2>&1)\e[0m" #10: Custom + (( ${aENABLED[0]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[0]} $GREEN_SEPERATOR $(mawk 'NR==2 {print $0}' /DietPi/dietpi/.hw_model 2>&1)" #0: Device model + (( ${aENABLED[1]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[1]} $GREEN_SEPERATOR $(uptime -p 2>&1)" #1: Uptime + (( ${aENABLED[2]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[2]} $GREEN_SEPERATOR $(print_full_info=1 G_OBTAIN_CPU_TEMP 2>&1)" #2: CPU temp + (( ${aENABLED[3]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[3]} $GREEN_SEPERATOR $(hostname -f 2>&1)" #3: Hostname + (( ${aENABLED[4]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[4]} $GREEN_SEPERATOR $(hostname -y 2>&1)" #4: Domain name + (( ${aENABLED[5]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[5]} $GREEN_SEPERATOR $(mawk 'NR==3 {dev=$0} NR==4 {print $0" ("dev")"}' /DietPi/dietpi/.network 2>&1)" #5: LAN IP (adapter) + (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPERATOR $(curl -sLm 2 https://dietpi.com/myip.php 2>&1)" #6: WAN IP # Move this to /DietPi/dietpi/.network? + (( ${aENABLED[7]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[7]} $GREEN_SEPERATOR $(df -h --output=avail / | mawk 'NR==2 {print $1}' 2>&1)" #7: Freespace (RootFS) + (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPERATOR $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)" #8: Freespace (DietPi userdata) + (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPERATOR $(curl -sLm 2 https://wttr.in/?format=4 2>&1)" #9: Weather + (( ${aENABLED[10]} == 1 )) && [[ -x $FP_CUSTOM ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[10]} $GREEN_SEPERATOR $(bash $FP_CUSTOM 2>&1)" #10: Custom echo -e "$GREEN_LINE\n" Print_Credits @@ -251,19 +268,19 @@ NB: It is executed as bash script, so it needs to be in bash compatible syntax. #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - + #----------------------------------------------------------------------------------- + Load + #----------------------------------------------------------------------------------- if (( $INPUT == 0 )); then Print_Header elif (( $INPUT == 1 )); then - Load Print_Banner elif (( $INPUT == 2 )); then - Load Menu_Main Print_Banner From 17c7553a68e8cd7b0287c86ee50d2287430d83fb Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 23 Mar 2019 23:39:54 +0100 Subject: [PATCH 232/232] v6.22 + CHANGELOG | Add v6.22 release day; Update v6.22 file changes link; Minor wording and typos --- CHANGELOG.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 41cda9cb75..6cbaf6444b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,30 +1,30 @@ v6.22 -(xx/03/19) +(23/03/19) Changes / Improvements / Optimisations: - Security | The DietPi-Software global password is now stored with enhanced security which also resolves a warning on Buster systems: https://github.com/MichaIng/DietPi/issues/2213 -- System | /etc/bashrc.d/ now allows ".bash" file ending as well. Merged all contained DietPi scripts into one: /etc/bashrc.d/dietpi.bash. https://github.com/MichaIng/DietPi/pull/2636 -- General | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives. This allows us to lower DietPi core package dependencies from "p7zip-full" to "p7zip". -- RPi | DietPi does not set or change "framebuffer_depth" in config.txt anymore which defaults to 16 which works in every known case. It will be re-added as fast as we find a case where another value is required. +- System | /etc/bashrc.d/ now allows ".bash" file ending as well. We merged all contained DietPi scripts into one (/etc/bashrc.d/dietpi.bash): https://github.com/MichaIng/DietPi/pull/2636 +- General | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives. This allows us to lower the DietPi core package dependency from "p7zip-full" to "p7zip". +- RPi | DietPi does not set or change "framebuffer_depth" in config.txt any more which defaults to 16 which works in every known case. It will be re-added as fast as we find a case where another value is required. - DietPi-Banner | You can now customise which options to display during system login. These include CPU temps, WAN IP, free disk space and more! Simply run 'dietpi-banner': https://github.com/MichaIng/DietPi/issues/2627 - DietPi-NordVPN | Added sent/received usage stats for VPN tunnel. -- DietPi-Sync | Sync will now abort if the source dir is empty. Merged dry run into real sync, as this was performed anyway to do required free space check. When "Sync" is selected, after dry run the user is presented a summary and given the option to view the detailed dry run log, cancel or continue with real sync. Some other minor fixes and enhancements have been applied as well. Many thanks to @midnightwatcher for doing this request: https://dietpi.com/phpbb/viewtopic.php?f=12&t=5588 +- DietPi-Sync | Sync will now abort if the source directory is empty. Merged dry run into real sync, as this was performed anyway to do required free space check. When "Sync" is selected, after dry run the user is presented a summary and given the option to view the detailed dry run log, cancel or continue with real sync. Some other minor fixes and enhancements have been applied as well. Many thanks to @midnightwatcher for doing this request: https://dietpi.com/phpbb/viewtopic.php?f=12&t=5588 - DietPi-Software | Emby Server: Now installs the latest version automatically (currently 4.0.2) which as well offers a native ARMv8 package: https://github.com/MichaIng/DietPi/pull/2525 - DietPi-Software | WireGuard: Switched from 10.8.0.0 to 10.9.0.0 IP addresses on fresh installs to avoid doubled IP range use with OpenVPN. Many thanks to @XRay437 for pointing this out: https://github.com/MichaIng/DietPi/issues/2491#issuecomment-461366739 -- DietPi-Software | WireGuard: Changed the way users are adviced to add multiple clients, to enhance concurrent connections. Many thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/MichaIng/DietPi/issues/2491#issuecomment-462419860 -- DietPi-Software | WireGuard: Hardened "sid" repo handling on RPi to prevent accidental non-WireGuard package installs. Many thanks to @rucknapucknavitz @1985kasper and @g7kse for reporting this issue: https://github.com/MichaIng/DietPi/issues/2568#issuecomment-465725312 +- DietPi-Software | WireGuard: Changed the way users are advised to add multiple clients, to enhance concurrent connections. Many thanks to @curiosity-seeker for reporting and testing this issue: https://github.com/MichaIng/DietPi/issues/2491#issuecomment-462419860 +- DietPi-Software | WireGuard: Hardened Debian Sid repo handling on RPi to prevent accidental non-WireGuard package installs. Many thanks to @rucknapucknavitz @1985kasper and @g7kse for reporting this issue: https://github.com/MichaIng/DietPi/issues/2568#issuecomment-465725312 - DietPi-Software | GMediaRender: Enabled support for Debian/Raspbian Buster by using the up-to-date APT repo package. - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/MichaIng/DietPi/pull/2538 - DietPi-Software | UrBackup: Now installs updated version 2.3.7. Many thanks to @DeathIsUnknown for the information: https://github.com/MichaIng/DietPi/issues/2577 - DietPi-Software | Deluge: Reworked the installer to better match the Debian package defaults and recommendations/examples from official docs. Deluge now runs as user "debian-deluged", logs have been moved to "/var/log/deluged/" and the init.d service with its traces are removed, which are all pre-generated by the Debian APT package. The systemd units have been adjusted according to the official Deluge documentation. These changes are applied as well to existing installs during DietPi update, the old user "deluge" and obsolete configurations are removed. Your active configurations and data are preserved, the installer has been as well enhanced to better handle existing installs and never touch existing configs. Note that access to the Deluge console has to be done as user "debian-deluged" (sudo -u debian-deluged deluge-console). A related access issue to the console has been fixed by this as well. Many thanks to @seanmikhaels for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5525 - DietPi-Software | AmiBerry: Updated to latest version (2.25), thanks @midwan: https://github.com/MichaIng/DietPi/issues/2599 - DietPi-Software | Netdata: On Debian Stretch/Buster and Raspbian Buster an up-to-date APT package is available, which will now be installed instead of our custom build. Many thanks to @74cmonty for this information: https://github.com/MichaIng/DietPi/issues/2446 -- DietPi-Software | DietPi-RAMlog: When installing/enabling RAMlog, the /var/log mountpoint will be now cleaned before mounting the tmpfs on it, while preserving the existing logs metadata. This resolves a warning on early boot stage and frees the disk space consumed by the disk log before. +- DietPi-Software | DietPi-RAMlog: When installing/enabling RAMlog, the /var/log mount point will be now cleaned before mounting the tmpfs on it, while preserving the existing logs metadata. This resolves a warning on early boot stage and frees the disk space consumed by the disk log before. - DietPi-Software | rTorrent: Runs now as user "rtorrent" and creates files as group "dietpi" with 775/664 permissions. Enabled Buster support and enhanced config file handling on reinstall: https://github.com/MichaIng/DietPi/pull/2633 - DietPi-Software | Plex Media Server: Now installs the latest version automatically (currently 1.15) which as well includes official ARM binaries. Many thanks to @WolfganP for informing us about this new release: https://github.com/MichaIng/DietPi/issues/2553 - DietPi-Software | Nextcloud: Resolved an admin panel warning about missing ocm/ocs-provider redirects. Many thanks to @minnux for reporting this issue: https://github.com/MichaIng/DietPi/issues/2638 -- DietPi-Software | Allo GUI: Updated to version 13. Provides for view the USB status and sound card status on Dietpi Allo web GUI system status page. Many thanks to @sudeep!: https://github.com/sparky-sbc/sparky-test/tree/master/dietpi-gui-usbdebug +- DietPi-Software | Allo GUI: Updated to version 13. Provides for view the USB status and sound card status on DietPi Allo web GUI system status page. Many thanks to @sudeep!: https://github.com/sparky-sbc/sparky-test/tree/master/dietpi-gui-usbdebug Bug Fixes: - System | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2529 @@ -43,13 +43,13 @@ Bug Fixes: - DietPi-Software | WireGuard: Resolved an issue where on uninstall the Debian Sid repo was not removed from APT sources. Many thanks to @XRay437 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2545 - DietPi-Software | Java: Resolved possible install failures on ARM. Many thanks to @WTFMaster for reporting this issue: https://github.com/MichaIng/DietPi/issues/2524 - DietPi-Software | Remot3.it: Resolved an issue where install failed due to Git repo changes. Additionally Remot3.it is now available on x86_64 and ARMv8 systems as well. Many thanks to @techano for reporting this issue: https://github.com/MichaIng/DietPi/issues/2551 -- DietPi-Software | Pi-hole: Resolved an issue where "pihole -up" fails because of wrong file permissions. Many thanks to @jonare77 for resporting this issue: https://github.com/MichaIng/DietPi/issues/2516 +- DietPi-Software | Pi-hole: Resolved an issue where "pihole -up" fails because of wrong file permissions. Many thanks to @jonare77 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2516 - DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service to ensure the MPD user can use both dietpi and audio groups: https://github.com/MichaIng/DietPi/issues/2462 - DietPi-Software | Airsonic: Resolved an issue where during install the FFmpeg transcoder symlink could be placed wrong, leading to a failing Airsonic start. Many thanks to @pecan_pie for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5637 - DietPi-Software | DietPi-RAMlog: Fixed an issue where logging mode could be set wrong when uninstalling and reinstalling RAMlog. Many thanks to @abecvar for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5666 - DietPi-Software | rTorrent: Resolved an issue where the ruTorrent web UI could not connect to the rTorrent daemon. Many thanks to @Chester007 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5656 -As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pulls?q=is%3Aclosed+base%3Amaster +As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/2653/files Known/Outstanding Issues: - DietPi-Config | Enabling WiFi + Ethernet adapters, both on different subnets, breaks WiFi connection in some cases: https://github.com/MichaIng/DietPi/issues/2103