diff --git a/.conf/dps_114/lighttpd.nextcloud.conf b/.conf/dps_114/lighttpd.nextcloud.conf index e3b242844e..d7337c9267 100644 --- a/.conf/dps_114/lighttpd.nextcloud.conf +++ b/.conf/dps_114/lighttpd.nextcloud.conf @@ -16,7 +16,7 @@ $HTTP["url"] =~ "^/nextcloud($|/)" { # - Files $HTTP["url"] =~ "^/nextcloud/(\.|autotest|occ|issue|indie|db_|console)" { url.access-deny = ("") } # - Directory listing - dir-listing.active = "disable" + dir-listing.activate = "disable" # - Cache control and security headers for static resources $HTTP["url"] =~ "^/nextcloud/.*\.(css|js|woff2?|svg|gif)$" { setenv.add-response-header += ( diff --git a/.conf/dps_47/lighttpd.owncloud.conf b/.conf/dps_47/lighttpd.owncloud.conf index 0f6211d132..d225c7ff3b 100644 --- a/.conf/dps_47/lighttpd.owncloud.conf +++ b/.conf/dps_47/lighttpd.owncloud.conf @@ -10,7 +10,7 @@ $HTTP["url"] =~ "^/owncloud($|/)" { # - Files $HTTP["url"] =~ "^/owncloud/(\.|autotest|occ|issue|indie|db_|console)" { url.access-deny = ("") } # - Directory listing - dir-listing.active = "disable" + dir-listing.activate = "disable" # - Cache control and security headers for static resources $HTTP["url"] =~ "^/owncloud/.+\.(css|js)" { setenv.add-response-header += ( diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e0cd6008ff..32fcc597b9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,6 @@ v6.23 -(XX/05/19) +(12/05/19) Jessie support: - The support for Debian Jessie is fading constantly by software titles and Debian itself, increasing the effort for us to work around the raising issues: https://github.com/MichaIng/DietPi/issues/2332 @@ -12,6 +12,7 @@ Changes / Improvements / Optimisations: - DietPi-Banner | Added support for DietPi message of the day (MOTD). This is enabled by default, however, can be disabled. Checks for latest MOTD once a day. - DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681 - DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100MB (from 10MB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. +- DietPi-Cleaner | Added a confirmation prompt, before removal of manpages and docs, as this may cause APT issues in some circumstances: - DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449 - DietPi-Arr_to_RAM | With v6.18 we silently added a new script (for Stretch and above) that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689 - DietPi-Drive_Manager | encryptfs and vboxsf (VirtualBox shared folder) fstab entries are now preserved. Many thanks to @johnvick and @Phil1988 for suggesting: https://github.com/MichaIng/DietPi/issues/2078, https://github.com/MichaIng/DietPi/issues/2202 @@ -28,9 +29,11 @@ Changes / Improvements / Optimisations: - DietPi-Software | LXQt, GIMP, XFCE4 Power manager: Now available for installations. - DietPi-Software | Plex Media Server: All systems are migrated to the new official APT repository. This allows easy and consistent upgrades via APT. On ARM systems the until now used 3rd party dev2day repo receives no further updates and will be shut down soon, which makes the migration mandatory. Many thanks to @WolfganP for keeping us informed with news about Plex v1.15 and the new APT repo: https://github.com/MichaIng/DietPi/issues/2655 - DietPi-Software | Logitech Media Server: Now installs the latest nightly version, since no public "releases" are done. As well the systemd service has gone through some update and now runs as limited user to align with other media servers, enhance security and follow the defaults of the DPKG package. The update/change is applied to existing installs via DietPi-Update as well. Your settings/date are preserved. -- DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 - DietPi-Software | Nextcloud Talk: We do not apply (D)TLS settings to coTURN any more. Since WebRTC is encrypted by itself there is no security benefit. More importantly Nextcloud Talk does not make use of the required TURNS protocol, so there is absolutely no point to apply these settings. The (D)TLS feature is meant to allow passing firewalls that only allow encrypted traffic. WebRTC, although encrypted, might not pass such firewalls since the encryption is not on transport layer. For those how are interested in further details and discussion: https://github.com/coturn/coturn/issues/33, https://github.com/nextcloud/spreed/issues/257 - DietPi-Software | SABnzbd: Install latest version via GitHub master and skip adjusting existing config file. Systemd unit and dependencies have been adjusted to match minimum requirements and official documentation. The update will be applied via DietPi v6.23 patch as well. Many thanks to @19eighties for reporting the outdated version: https://github.com/MichaIng/DietPi/issues/2762 +- DietPi-Software | Jackett: On non-ARMv6 devices the new (v0.11+) standalone (non-mono) binary is installed now. This is applied on DietPi-Update as well, preserving your settings: https://github.com/MichaIng/DietPi/pull/2773 +- DietPi-Software | Blynk: Enabled support for Debian Buster by using the new Java 11 binary. +- DietPi-Software | UrBackup: New version 2.3.8 is installed now. Many thanks to @DeathIsUnknown for informing us about the update: https://github.com/MichaIng/DietPi/issues/2783 Bug Fixes: - System | Debian has vastly reduced support for Jessie systems from their official APT repository. The limited possible list entries are applied during DietPi-Update. Many thanks to @BerndKohl for reporting this issue: https://github.com/MichaIng/DietPi/issues/2665 @@ -47,13 +50,17 @@ Bug Fixes: - DietPi-Software | Fail2Ban: Resolved an issue where the service silently failed due to wrong log level settings on Stretch and Buster systems. Many thanks to @joaofl for reporting this issue: https://github.com/MichaIng/DietPi/issues/90#issuecomment-485140236 - DietPi-Software | Redis: Resolved an issue on Jessie systems where the service fails to start due to wrong shipped permissions from Debian package: https://github.com/MichaIng/DietPi/issues/2736 - DietPi-Software | Nextcloud: Resolved an issue on Lighttpd with HTTPS enabled where OPcache settings were not applied as desired, leading to a warning on Nextcloud admin panel. Many thanks to @Borotes for reporting this issue: https://github.com/MichaIng/DietPi/issues/2489 +- DietPi-Software | Nextcloud/ownCloud: Fixed a wrong directive in our Lighttpd configs. Many thanks to @WilburWalsh for reporting this issue: https://github.com/MichaIng/DietPi/issues/2775 - DietPi-Software | Nextcloud Talk: Resolved an issue where coTURN prints two warnings about deprecated settings on Buster systems, due to some changes with latest versions. - DietPi-Software | Kodi: Resolved an issue on RPi where Kodi (v18) fails to start when a custom screen resolution was chosen. Many thanks to @johnnypea for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=17550#p17550 - DietPi-Software | Java: Resolved an issue where install fails on Jessie systems since the used jessie-backports APT repo does not exist any more: https://github.com/MichaIng/DietPi/issues/2752 - DietPi-Software | Java: Resolved an issue where install fails on Buster systems since OpenJDK 8 packages are not available any more on Buster repo. OpenJDK 11 is installed instead, testing with Java software titles is outstanding. - DietPi-Software | Node.js: Resolved an issue where install failed on ARMv6 since Node 12 does not support it any more. Many thanks to @axwax for reporting this issue: https://github.com/MichaIng/DietPi/issues/2755 +- DietPi-Software | Tor/WiFi Hotspot: Resolved an issue where WiFi Hotspot fails to start when Tor Hotspot is installed. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2673#issuecomment-482605700 +- DietPi-Software | Jackett: Resolved an issue where service start fails after using the internal updater. Many thanks to @DeathIsUnknown for reporting this issue and providing a solution: https://github.com/MichaIng/DietPi/issues/2593#issuecomment-490096681 +- DietPi-Software | Blynk: Resolved an issue where logging failed and changed the default log dir to /var/log/blynk. Many thanks to @Phil1988 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2777 -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/XXXX/files +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/2784 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 diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 3d9cbf7391..78bb0741eb 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -403,13 +403,17 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners # Purge if (( $DRY_RUN )); then - apt-get -s purge man manpages + apt-get -s purge man-db manpages else - G_AGP man manpages + G_AGP man-db manpages G_AGA - rm -Rf /usr/share/{man,doc,doc-base} + if G_WHIP_YESNO '[WARNING] Removing installed man pages and docs causes errors during "apt-get upgrade" in rare cases (https://github.com/MichaIng/DietPi/issues/2751).\n\nNB: If unsure, please select "Cancel".\n\nDo you wish to continue?'; then + + rm -Rf /usr/share/{man,doc,doc-base} + + fi fi diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 2a9860be18..90d98a20d6 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -46,7 +46,7 @@ #///////////////////////////////////////////////////////////////////////////////////// # Obtain Installed software #///////////////////////////////////////////////////////////////////////////////////// - Load_Installed_Software(){ [[ -f /DietPi/dietpi/.installed ]] && . /DietPi/dietpi/.installed; } + Load_Installed_Software(){ [[ -f '/DietPi/dietpi/.installed' ]] && . /DietPi/dietpi/.installed; } #///////////////////////////////////////////////////////////////////////////////////// # Whiltail Info @@ -311,7 +311,7 @@ fi # Odroid Remote - if (( $G_HW_MODEL >= 10 && $G_HW_MODEL <= 12 )); then + if (( $G_HW_MODEL > 9 && $G_HW_MODEL < 13 )); then local odroid_remote_text='[Off]' local odroid_remote_enabled=0 @@ -1315,7 +1315,8 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi G_WHIP_MENU_ARRAY+=('RTC mode' ": [$rtc_text]") - G_WHIP_MENU_ARRAY+=('Update firmware' '') + # Hide firmware update on RPi. This is done automatically with simple apt upgrade since raspberrypi-kernel it is no meta-package. + (( $G_HW_MODEL > 9 )) && G_WHIP_MENU_ARRAY+=('Update firmware' '') # Serial/UART devices G_WHIP_MENU_ARRAY+=('Serial/UART' ': Manage available devices') @@ -1429,7 +1430,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 local old_firmware=$(ls /lib/modules/) # Pine A64: Non-ARMbian only - if (( $G_HW_MODEL == 40 && -f /usr/local/sbin/pine64_update_uboot.sh && -f /usr/local/sbin/pine64_update_kernel.sh )); then + if [[ $G_HW_MODEL == 40 && -f '/usr/local/sbin/pine64_update_uboot.sh' && -f '/usr/local/sbin/pine64_update_kernel.sh' ]]; then if G_WHIP_YESNO "Would you like to update the firmware/kernel for $G_HW_MODEL_DESCRIPTION? - This will run longsleep's update scripts to update the U-Boot and kernel."; then @@ -1609,7 +1610,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 fi - #Intel boost option (eg: i5-6200U, disables 2.9GHz mode, limits to 2.3GHz) + # Intel boost option (eg: i5-6200U, disables 2.9GHz mode, limits to 2.3GHz) local intel_boost_disabled=0 local intel_boost_text='Enabled' if grep -qi 'genuineintel' /proc/cpuinfo; then @@ -2281,7 +2282,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 Network_ETH_CopyCurrentToStatic(){ - #Apply, Only if we have a connection + # Apply, Only if we have a connection if (( $ETH_CONNECTED == 1 )); then ETH_IP_STATIC=$ETH_IP @@ -2295,7 +2296,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500 Network_WIFI_CopyCurrentToStatic(){ - #Apply, Only if we have a connection + # Apply, Only if we have a connection if (( $WIFI_CONNECTED == 1 )); then WIFI_IP_STATIC=$WIFI_IP @@ -2523,7 +2524,7 @@ _EOF_ Change_StaticDns(){ - #$1 = Adapater type | 0=Eth, 1=WiFi + # $1 = Adapater type | 0=Eth, 1=WiFi # Store current into var local current_value=0 @@ -3308,7 +3309,6 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then fi - G_WHIP_MENU_ARRAY+=('' '●─ Additional Options ') # - Unset country code? if [[ $WIFI_COUNTRYCODE == '00' ]]; then @@ -3560,7 +3560,7 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then TARGETMENUID=11 # - Init/load previous bench results - [[ -f /var/lib/dietpi/dietpi-benchmark/results ]] || /DietPi/dietpi/func/dietpi-benchmark 0 + [[ -f '/var/lib/dietpi/dietpi-benchmark/results' ]] || /DietPi/dietpi/func/dietpi-benchmark 0 . /var/lib/dietpi/dietpi-benchmark/results # - Sanity for beta testing. As this value won't exist until re-save of /var/lib/dietpi/dietpi-benchmark/results @@ -3577,7 +3577,7 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then ) G_WHIP_DEFAULT_ITEM='DietPi-Benchmark' - G_WHIP_MENU "\ + if G_WHIP_MENU "\ DietPi-Benchmark | https://dietpi.com/survey#benchmark : - CPU Performance : Duration = $BENCH_CPU seconds (lower is faster) - CPU Temp : Idle = ${BENCH_CPU_TEMP_START}'c | Full load = ${BENCH_CPU_TEMP_END}'c @@ -3586,8 +3586,7 @@ DietPi-Benchmark | https://dietpi.com/survey#benchmark : Additional benchmarks: - Custom Filesystem : Write = $BENCH_CUSTOMFS_WRITE MB/s | Read = $BENCH_CUSTOMFS_READ MB/s - - Network LAN : Transfer rate = $BENCH_NET_LAN_SPEED MB/s" - if (( $? == 0 )); then + - Network LAN : Transfer rate = $BENCH_NET_LAN_SPEED MB/s"; then TARGETMENUID=12 # Return to this menu @@ -3670,7 +3669,7 @@ Additional benchmarks: sed -i '/core_freq=/c\#core_freq=250' /DietPi/config.txt sed -i '/sdram_freq=/c\#sdram_freq=450' /DietPi/config.txt - elif (( $G_HW_MODEL <= 1 )); then + elif (( $G_HW_MODEL < 2 )); then sed -i '/arm_freq=/c\#arm_freq=700' /DietPi/config.txt sed -i '/core_freq=/c\#core_freq=250' /DietPi/config.txt @@ -3748,6 +3747,7 @@ Additional benchmarks: TARGETMENUID=13 # Return to this menu case "$G_WHIP_RETURNED_VALUE" in + 'none') Reset_Overclocking diff --git a/dietpi/dietpi-explorer b/dietpi/dietpi-explorer index 25c7bdb730..a119e3e656 100644 --- a/dietpi/dietpi-explorer +++ b/dietpi/dietpi-explorer @@ -9,28 +9,27 @@ #//////////////////////////////////// # # Info: - # - filename /DietPi/dietpi/dietpi-explorer + # - Location: /DietPi/dietpi/dietpi-explorer # # Usage: # - dietpi-explorer (menu system) - # - dietpi-explorer 1 | Select a folder mode, return result for other applications to /tmp/.dietpi-explorer_selected_location + # - dietpi-explorer 1 Select a folder mode, return result for other applications to /tmp/.dietpi-explorer_selected_location #//////////////////////////////////// - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Explorer' G_CHECK_ROOT_USER G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # 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 CURRENT_DIRECTORY='' TARGET_FP='/home' - [[ $2 ]] && TARGET_FP="$2" + [[ $2 ]] && TARGET_FP=$2 - CP_MODE=0 #0=CP 1=MV + CP_MODE=0 # 0=CP 1=MV CP_SOURCE='' CP_TARGET='' @@ -40,7 +39,7 @@ if (( $CP_MODE == 0 )); then - G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD cp -R "$CP_SOURCE" "$CP_TARGET"/ + G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD cp -a "$CP_SOURCE" "$CP_TARGET"/ elif (( $CP_MODE == 1 )); then @@ -51,9 +50,9 @@ fi # - Reset for next run + CP_MODE=0 CP_SOURCE='' CP_TARGET='' - CP_MODE=0 } @@ -153,7 +152,7 @@ elif [[ $G_WHIP_RETURNED_VALUE == 'Select' ]]; then - echo -e "$CURRENT_DIRECTORY/$TARGET_FP" > /tmp/.dietpi-explorer_selected_location + echo "$CURRENT_DIRECTORY/$TARGET_FP" > /tmp/.dietpi-explorer_selected_location exit 0 elif [[ $G_WHIP_RETURNED_VALUE == 'Copy' ]]; then @@ -173,7 +172,7 @@ elif [[ $G_WHIP_RETURNED_VALUE == 'Rename' ]]; then - G_WHIP_DEFAULT_ITEM="$TARGET_FP" + G_WHIP_DEFAULT_ITEM=$TARGET_FP if G_WHIP_INPUTBOX "Please enter a new name for '$TARGET_FP'"; then G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD mv "$TARGET_FP" "$G_WHIP_RETURNED_VALUE" @@ -199,10 +198,10 @@ done <<< "$(getent passwd | cut -d: -f1 | sort)" - G_WHIP_DEFAULT_ITEM="$permission_current_user" + G_WHIP_DEFAULT_ITEM=$permission_current_user if G_WHIP_MENU 'Chown permissions:\n - Please select a User'; then - local chown_user="$G_WHIP_RETURNED_VALUE" + local chown_user=$G_WHIP_RETURNED_VALUE G_WHIP_MENU_ARRAY=() @@ -213,10 +212,10 @@ done <<< "$(getent group | cut -d: -f1 | sort)" - G_WHIP_DEFAULT_ITEM="$permission_current_group" + G_WHIP_DEFAULT_ITEM=$permission_current_group if G_WHIP_MENU 'Chown permissions:\n - Please select a Group'; then - local chown_group="$G_WHIP_RETURNED_VALUE" + local chown_group=$G_WHIP_RETURNED_VALUE G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD chown -R $chown_user:$chown_group "$CURRENT_DIRECTORY/$TARGET_FP" fi @@ -225,7 +224,7 @@ elif [[ $G_WHIP_RETURNED_VALUE == 'Chmod' ]]; then - G_WHIP_DEFAULT_ITEM="$chmod_current" + G_WHIP_DEFAULT_ITEM=$chmod_current if G_WHIP_INPUTBOX 'Chmod permissions:\n - Please enter a value'; then G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD chmod -R $G_WHIP_RETURNED_VALUE "$CURRENT_DIRECTORY/$TARGET_FP" @@ -245,10 +244,10 @@ #///////////////////////////////////////////////////////////////////////////////////// TARGETMENUID=0 - #TARGETMENUID=0 + # TARGETMENUID=0 Menu_Main(){ - CURRENT_DIRECTORY="$PWD" + CURRENT_DIRECTORY=$PWD G_WHIP_MENU_ARRAY=() if [[ $CURRENT_DIRECTORY == '/' ]]; then @@ -282,10 +281,10 @@ done G_WHIP_BUTTON_CANCEL_TEXT='Exit' - G_WHIP_DEFAULT_ITEM="$TARGET_FP" + G_WHIP_DEFAULT_ITEM=$TARGET_FP if G_WHIP_MENU "$CURRENT_DIRECTORY"; then - TARGET_FP="$G_WHIP_RETURNED_VALUE" + TARGET_FP=$G_WHIP_RETURNED_VALUE Select_Menu @@ -302,13 +301,11 @@ G_WHIP_SIZE_X_MAX=50 if G_WHIP_YESNO "Exit $G_PROGRAM_NAME?"; then - #exit - TARGETMENUID=-1 + TARGETMENUID=-1 # Exit else - #Return to Main Menu - TARGETMENUID=0 + TARGETMENUID=0 # Main menu fi @@ -317,11 +314,10 @@ #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - - #Default to users home dir + # Default to users home dir cd "$TARGET_FP" - #Start Menu + # Start Menu while (( $TARGETMENUID > -1 )) do diff --git a/dietpi/dietpi-morsecode b/dietpi/dietpi-morsecode index 80574db918..eed1fd491d 100644 --- a/dietpi/dietpi-morsecode +++ b/dietpi/dietpi-morsecode @@ -9,66 +9,57 @@ #//////////////////////////////////// # # Info: + # - Location: /DietPi/dietpi/dietpi-morsecode # - Converts and renders a text file into morse code # # Usage: - # - dietpi-morsecode 0/noinput = Output to Term - # - dietpi-morsecode 1 = Output to both RPi status LED's + # - dietpi-morsecode 0/noinput = Output to console/screen + # - dietpi-morsecode 1 = Output to both RPi status LEDs # - dietpi-morsecode 2 = Output to ALSA (sound) #//////////////////////////////////// - #At the end of the day, if your using this, your probably in a life threating situation. - #I doubt your Transmission downloads, or webserver is going to be more important. - #So, Lets change the nice to -10 (High priority) ;) + # At the end of the day, if your using this, your probably in a life threating situation. + # I doubt your Transmission downloads, or webserver is going to be more important. + # So, Lets change the nice to -10 (High priority) ;) renice -n -10 $$ &> /dev/null - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_PROGRAM_NAME='DietPi-Morsecode' G_CHECK_ROOT_USER G_INIT - #Import DietPi-Globals --------------------------------------------------------------- + # Import DietPi-Globals -------------------------------------------------------------- - G_EXIT_CUSTOM(){ [[ -f $FP_TEXTFILE_LOWERCASE ]] && rm $FP_TEXTFILE_LOWERCASE; } - - INPUT=0 - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 + # Grab input + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 #///////////////////////////////////////////////////////////////////////////////////// # Output Data #///////////////////////////////////////////////////////////////////////////////////// OUTPUT_MODE=$INPUT - - #OUTPUT_MODE_0 (TERM/SCREEN) - TERM_X=$(tput cols) - TERM_Y=$(tput lines) - TERM_TOTAL_CHARS=$(( $TERM_X * $TERM_Y - 1)) #How many printed chars are required to fill screen? - TERM_COLOUR='\e[48;5;15m' - - #OUTPUT_MODE_1 (RPI status LEDs) - - #OUTPUT_MODE_2 (Sound) + SOUND_PID=-1 Output_On(){ - #TERM/SCREEN Output + # console/screen if (( $OUTPUT_MODE == 0 )); then - #Set color - echo -e "$TERM_COLOUR" - printf '\ec' # clear current terminal screen + # Fill terminal with colour + # - 8bit colour code (light gray) for max terminal support + echo -ne '\e[H\e[47m\e[J' - #RPi status LEDs + # RPi status LEDs elif (( $OUTPUT_MODE == 1 )); then echo 1 > /sys/class/leds/led0/brightness echo 1 > /sys/class/leds/led1/brightness + # ALSA (sound) elif (( $OUTPUT_MODE == 2 )); then - #Isnt quick enough in bash. cant get buffer/latency low enough to make it usable. + # Isnt quick enough in bash. cant get buffer/latency low enough to make it usable. speaker-test -b 40000 -t sine -f 800 -l 1 -p 1 &> /dev/null & - pid=$! + SOUND_PID=$! fi @@ -76,22 +67,22 @@ Output_Off(){ - #TERM/SCREEN Output + # console/screen if (( $OUTPUT_MODE == 0 )); then - #reset colour - echo -e '\e[0m' - printf '\ec' # clear current terminal screen + # Reset colour + echo -ne '\e[H\e[0m\e[J' - #RPi status LEDs + # RPi status LEDs elif (( $OUTPUT_MODE == 1 )); then echo 0 > /sys/class/leds/led0/brightness echo 0 > /sys/class/leds/led1/brightness + # ALSA (sound) elif (( $OUTPUT_MODE == 2 )); then - kill -9 $pid + kill -9 $SOUND_PID #killall speaker-test &> /dev/null fi @@ -103,22 +94,22 @@ #///////////////////////////////////////////////////////////////////////////////////// CHAR_CURRENT=0 - #Filepaths - FP_TEXTFILE_INPUT="$HOME/dietpi-morsecode" - FP_TEXTFILE_LOWERCASE='/tmp/.dietpi-morsecode_lowercase' + # Filepaths + FP_TEXTFILE_INPUT='/root/dietpi-morsecode' + FP_TEXTFILE_LOWERCASE='.dietpi-morsecode_lowercase' - #Define single unit duration (essentially the speed at which the morse code is outputted) + # Define single unit duration (essentially the speed at which the morse code is outputted) MC_DURATION_UNIT=0.15 - #Dash and next char duration ( MC_DURATION_UNIT * 3 ) - MC_DURATION_DASH=$(echo - | mawk "{print $MC_DURATION_UNIT * 3}") - #New word duration ( MC_DURATION_UNIT * 7 ) - MC_DURATION_WORD=$(echo - | mawk "{print $MC_DURATION_UNIT * 7}") + # Dash and next char duration ( MC_DURATION_UNIT * 3 ) + MC_DURATION_DASH=$(mawk "{print $MC_DURATION_UNIT * 3}" <<< '') + # New word duration ( MC_DURATION_UNIT * 7 ) + MC_DURATION_WORD=$(mawk "{print $MC_DURATION_UNIT * 7}" <<< '') Mc_Convert_Input_Textfile_Lowercase(){ - echo -e 'DietPi-Morsecode\n\nConverting input file to lowercase......\n' + G_DIETPI-NOTIFY 1 'DietPi-Morsecode\n\nConverting input file to lowercase......\n' dd if="$FP_TEXTFILE_INPUT" of="$FP_TEXTFILE_LOWERCASE" conv=lcase &> /dev/null - echo -e "Completed\nRendering to Output_Mode $OUTPUT_MODE" + G_DIETPI-NOTIFY 1 "Completed\nRendering to Output_Mode $OUTPUT_MODE" } @@ -152,7 +143,7 @@ } - #AR + # AR Mc_End_of_Message(){ Mc_Next_Word @@ -441,26 +432,29 @@ #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - #Check for input file + # Check for input file if [[ ! -f $FP_TEXTFILE_INPUT ]]; then - printf '\ec' # clear current terminal screen - echo -e "\nNo textfile was found. Please create a file at:\n$FP_TEXTFILE_INPUT\nThis file will then be converted to Morse Code." - exit + + G_DIETPI-NOTIFY 1 "No textfile was found. Please create a file at:\n$FP_TEXTFILE_INPUT\nThis file will then be converted to Morse Code." + exit 1 + fi #----------------------------------------------------------------------------------- - #Convert input textfile file to lowercase + # Convert input textfile file to lowercase Mc_Convert_Input_Textfile_Lowercase #----------------------------------------------------------------------------------- - #Process file (read char one at a time, convert to morse code and render) + # Process file (read char one at a time, convert to morse code and render) + # - Clear screen in case of console/screen output mode + (( $OUTPUT_MODE == 0 )) && printf '\ec' while read -r -n1 CHAR_CURRENT do - #Space (new word) - if [[ $CHAR_CURRENT = ' ' ]]; then + # Space (new word) + if [[ $CHAR_CURRENT == [[:space:]] ]]; then Mc_Next_Word - #Next char + # Next char else Mc_Next_Char @@ -470,7 +464,7 @@ done < $FP_TEXTFILE_LOWERCASE - #Send end of message (AR) + # Send end of message (AR) Mc_End_of_Message #----------------------------------------------------------------------------------- exit diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d0d75f1ce6..2784519337 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -910,6 +910,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747' + # Pre-compiling required on ARM + (( $G_HW_ARCH < 10 )) && aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ software_id=142 @@ -2166,7 +2168,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=126 aSOFTWARE_WHIP_NAME[$software_id]='LibSSL1.0.0' - aSOFTWARE_WHIP_DESC[$software_id]='backwards compatibility (stretch)' + aSOFTWARE_WHIP_DESC[$software_id]='backwards compatibility (stretch+)' aSOFTWARE_CATEGORY_INDEX[$software_id]=4 aSOFTWARE_TYPE[$software_id]=1 @@ -2475,24 +2477,31 @@ DietPi-Software will decrypt and use it for software installs. You can change it fi - #Software that requires LibSSL1.0.0 - software_id=126 - if (( ${aSOFTWARE_INSTALL_STATE[37]} == 1 || - ${aSOFTWARE_INSTALL_STATE[60]} == 1 || - ${aSOFTWARE_INSTALL_STATE[97]} == 1 || - ${aSOFTWARE_INSTALL_STATE[134]} == 1 )); then + #Software that requires LibSSL1.0.0, Stretch+ only + if (( $G_DISTRO > 3 )); then - aSOFTWARE_INSTALL_STATE[$software_id]=1 - G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed" + # Jackett (147) + software_id=126 + if (( ${aSOFTWARE_INSTALL_STATE[37]} == 1 || + ${aSOFTWARE_INSTALL_STATE[60]} == 1 || + ${aSOFTWARE_INSTALL_STATE[97]} == 1 || + ${aSOFTWARE_INSTALL_STATE[134]} == 1 || + ${aSOFTWARE_INSTALL_STATE[147]} == 1 )); then + + aSOFTWARE_INSTALL_STATE[$software_id]=1 + G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed" + + fi fi #Software that requires Mono + # Jackett (147) on ARMv6: https://github.com/Jackett/Jackett#installation-on-linux-armv6-or-below software_id=150 if (( ${aSOFTWARE_INSTALL_STATE[106]} == 1 || ${aSOFTWARE_INSTALL_STATE[144]} == 1 || ${aSOFTWARE_INSTALL_STATE[145]} == 1 || - ${aSOFTWARE_INSTALL_STATE[147]} == 1 )); then + ( ${aSOFTWARE_INSTALL_STATE[147]} == 1 && $G_HW_ARCH == 1 ) )); then aSOFTWARE_INSTALL_STATE[$software_id]=1 G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed" @@ -2509,6 +2518,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it fi #Software that requires Python-Pip: https://github.com/MichaIng/DietPi/issues/784 + # OctoPrint (153) + # HTPC Manager (155) software_id=130 if (( ${aSOFTWARE_INSTALL_STATE[99]} == 1 || ${aSOFTWARE_INSTALL_STATE[118]} == 1 || @@ -2516,6 +2527,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it ${aSOFTWARE_INSTALL_STATE[139]} == 1 || ${aSOFTWARE_INSTALL_STATE[142]} == 1 || ${aSOFTWARE_INSTALL_STATE[153]} == 1 || + ${aSOFTWARE_INSTALL_STATE[155]} == 1 || ${aSOFTWARE_INSTALL_STATE[169]} == 1 )); then aSOFTWARE_INSTALL_STATE[$software_id]=1 @@ -3054,24 +3066,24 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di [[ -f $target ]] && G_WHIP_MSG "[INFO] Updating file: $target" G_RUN_CMD mv $file "$target" - elif [[ $type == deb ]]; then + elif [[ $type == 'deb' ]]; then # - Allow error on first attempt, giving APT fix a change to resolve e.g. dependencies G_USER_INPUTS=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD dpkg --force-hold,confdef,confold -i $file (( $G_ERROR_HANDLER_EXITCODE_RETURN )) && G_DIETPI-NOTIFY 2 'Trying automated APT fix' && G_AGF - elif [[ $type == zip ]]; then + elif [[ $type == 'zip' ]]; then [[ $target ]] && target="-d $target" G_RUN_CMD unzip -o $file "$target" - elif [[ $type == tar ]]; then + elif [[ $type == 'tar' ]]; then #[[ $target ]] && target="--one-top-level=$target" # Option exist not on Jessie [[ $target ]] && G_RUN_CMD mkdir -p "$target" && target="-C $target" G_RUN_CMD tar xf $file "$target" - elif [[ $type == 7z ]]; then + elif [[ $type == '7z' ]]; then [[ $target ]] && target="-o$target" G_RUN_CMD 7zr x -y $file "$target" @@ -3242,8 +3254,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #vsFTPD - software_id=95 + software_id=95 # vsFTPD if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3251,8 +3262,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #NFS_SERVER - software_id=109 + software_id=109 # NFS Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3266,8 +3276,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #WEBSERVER_APACHE - software_id=83 + software_id=83 # Apache Webserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3278,8 +3287,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #WEBSERVER_NGINX - software_id=85 + software_id=85 # Nginx Webserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3290,8 +3298,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #WEBSERVER_LIGHTTPD - software_id=84 + software_id=84 # Lighttpd Webserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3300,8 +3307,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #WEBSERVER_MARIADB - software_id=88 + software_id=88 # MariaDB Database if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3316,7 +3322,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di # - Remove possible dead symlinks/files: rm $G_FP_DIETPI_USERDATA/mysql &> /dev/null mkdir -p $G_FP_DIETPI_USERDATA/mysql - if [[ -d /var/lib/mysql ]]; then + if [[ -d '/var/lib/mysql' ]]; then G_DIETPI-NOTIFY 2 '/var/lib/mysql exists, will migrate containing databases' G_RUN_CMD cp -a /var/lib/mysql/. $G_FP_DIETPI_USERDATA/mysql @@ -3326,7 +3332,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi G_DIETPI-NOTIFY 2 'Removing /var/lib/mysql, if existent' - [[ -L /var/lib/mysql && ! $(readlink /var/lib/mysql) =~ $G_FP_DIETPI_USERDATA/mysql ]] && + [[ -L '/var/lib/mysql' && ! $(readlink /var/lib/mysql) =~ $G_FP_DIETPI_USERDATA/mysql ]] && rm -R "$(readlink /var/lib/mysql)" &> /dev/null rm -R /var/lib/mysql &> /dev/null @@ -3351,8 +3357,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #WEBSERVER_SQLITE - software_id=87 + software_id=87 # SQLite Database if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3363,8 +3368,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di fi - #WEBSERVER_REDIS - software_id=91 + software_id=91 # Redis Database if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3388,8 +3392,7 @@ ExecStartPre=$(command -v chown) -R redis:redis /var/run/redis /var/lib/redis" > fi - #WEBSERVER_PHP - software_id=89 + software_id=89 # PHP if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3472,13 +3475,12 @@ Package: openssl libssl1.1\nPin: origin packages.sury.org\nPin-Priority: -1' > / fi - #WEBSERVER_MYADMINPHP - software_id=90 + software_id=90 # phpMyAdmin if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #MySQL must be running during install to allow debconf setup. + # MariaDB must be running during install to allow debconf setup. G_RUN_CMD systemctl start $MARIADB_SERVICE # Set password parameters before installing @@ -3548,13 +3550,13 @@ We work around this error by running APT a second time. Please do not worry and fi - software_id=54 # Forums phpBB + software_id=54 # phpBB Forum if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing # Skip install, if already present - if [[ -d /var/www/phpBB3 ]]; then + if [[ -d '/var/www/phpBB3' ]]; then G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} install dir \"/var/www/phpBB3\" already exists. Download and install steps will be skipped. - If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please follow the instructions from WebUI ACP. @@ -3573,42 +3575,42 @@ We work around this error by running APT a second time. Please do not worry and Banner_Installing + # Install Golang Go: https://golang.org/dl/ # - x86_64 if (( $G_HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.9.linux-amd64.tar.gz' + INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.10.linux-amd64.tar.gz' # - ARMv8 elif (( $G_HW_ARCH == 3 )); then - INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.9.linux-arm64.tar.gz' + INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.10.linux-arm64.tar.gz' # - ARMv6/7 else - INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.9.linux-armv6l.tar.gz' + INSTALL_URL_ADDRESS='https://dl.google.com/go/go1.11.10.linux-armv6l.tar.gz' fi Download_Install "$INSTALL_URL_ADDRESS" /usr/local/ + # Export Go path variables mkdir -p $G_FP_DIETPI_USERDATA/go cat << _EOF_ > /etc/bashrc.d/go.sh #!/bin/bash export GOPATH=$G_FP_DIETPI_USERDATA/go export PATH=\$PATH:/usr/local/go/bin:$G_FP_DIETPI_USERDATA/go/bin _EOF_ - . /etc/bashrc.d/go.sh - # - Install OB + # Install OpenBazaar G_DIETPI-NOTIFY 2 "Installing ${aSOFTWARE_WHIP_NAME[$software_id]}, please wait, this will take some time (1-5 minutes)" G_RUN_CMD go get github.com/OpenBazaar/openbazaar-go fi - #YACY - software_id=133 + software_id=133 # YaCy if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3616,13 +3618,12 @@ _EOF_ fi - #Folding@Home - software_id=2 + software_id=2 # Folding@Home if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - We must uninstall previous package for reinstall, else it will fail: https://github.com/MichaIng/DietPi/issue_comments#issuecomment-411688073 + # We must uninstall previous package for reinstall, else it will fail: https://github.com/MichaIng/DietPi/issue_comments#issuecomment-411688073 if dpkg-query -s 'fahclient' &> /dev/null; then G_DIETPI-NOTIFY 2 'Removing previous package before installing the latest version' @@ -3639,7 +3640,7 @@ _EOF_ Download_Install 'https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v7.5/latest.deb' - killall -w FAHClient #due to https://github.com/FoldingAtHome/fah-issues/issues/1193 + killall -w FAHClient # Due to https://github.com/FoldingAtHome/fah-issues/issues/1193 fi @@ -3649,7 +3650,7 @@ _EOF_ Banner_Installing DEPS_LIST="$PHP_NAME-intl" # https://doc.owncloud.org/server/administration_manual/installation/manual_installation.html#php-extensions - if [[ -f /var/www/owncloud/occ ]]; then + if [[ -f '/var/www/owncloud/occ' ]]; then G_DIETPI-NOTIFY 2 'Existing ownCloud installation found, will NOT overwrite...' @@ -3684,7 +3685,7 @@ _EOF_ Banner_Installing DEPS_LIST="$PHP_NAME-intl" # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - if [[ -f /var/www/nextcloud/occ ]]; then + if [[ -f '/var/www/nextcloud/occ' ]]; then G_DIETPI-NOTIFY 2 'Existing Nextcloud installation found, will NOT overwrite...' @@ -3723,8 +3724,7 @@ _EOF_ fi - #YMPD - software_id=32 + software_id=32 # ympd if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3802,7 +3802,7 @@ _EOF_ Banner_Installing - #Sourcebuild pre-reqs + # Sourcebuild pre-reqs DEPS_LIST='cppcheck pkg-config libssl-dev libmpdclient-dev libmpdclient2 cmake' #Download_Install 'https://github.com/jcorporation/myMPD/archive/master.zip' @@ -3811,6 +3811,7 @@ _EOF_ cd myMPD* G_RUN_CMD ./mkrelease.sh cd /tmp/$G_PROGRAM_NAME + rm -R myMPD* fi @@ -3890,7 +3891,7 @@ _EOF_ # Install our config file only, if not yet existent, to preserve manual user config. # - This needs to be done prior to APT install, since this would otherwise install a default config file as well. - [[ -f /etc/mopidy/mopidy.conf ]] || dps_index=$software_id Download_Install 'mopidy.conf' /etc/mopidy/mopidy.conf + [[ -f '/etc/mopidy/mopidy.conf' ]] || dps_index=$software_id Download_Install 'mopidy.conf' /etc/mopidy/mopidy.conf curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add - # No Buster list available yet, use stretch.list for testing: @@ -3965,8 +3966,7 @@ _EOF_ fi - #MINIDLNA - software_id=39 + software_id=39 # MiniDLNA if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4017,8 +4017,7 @@ _EOF_ fi - #dxx-rebirth - software_id=112 + software_id=112 # DDX-Rebirth if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4034,17 +4033,17 @@ _EOF_ Banner_Installing # ARMv7 - INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.3.7/urbackup-server_2.3.7_armhf.deb' + INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/latest/urbackup-server_2.3.8_armhf.deb' # x86_64 if (( $G_HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.3.7/urbackup-server_2.3.7_amd64.deb' + INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/latest/urbackup-server_2.3.8_amd64.deb' # ARMv8 source elif (( $G_HW_ARCH == 3 )); then - INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/2.3.7/urbackup-server-2.3.7.tar.gz' + INSTALL_URL_ADDRESS='https://hndl.urbackup.org/Server/latest/urbackup-server-2.3.8.tar.gz' fi @@ -4060,7 +4059,7 @@ _EOF_ G_RUN_CMD make -j $G_HW_CPU_CORES G_RUN_CMD make install - sed -i "/ExecStart=/c ExecStart=/usr/local/bin/urbackupsrv run --config /etc/default/urbackupsrv --no-consoletime" urbackup-server.service + sed -i '/ExecStart=/c ExecStart=/usr/local/bin/urbackupsrv run --config /etc/default/urbackupsrv --no-consoletime' urbackup-server.service cp urbackup-server.service /etc/systemd/system/urbackupsrv.service cp defaults_server /etc/default/urbackupsrv cp logrotate_urbackupsrv /etc/logrotate.d/urbackupsrv @@ -4083,7 +4082,7 @@ _EOF_ Banner_Installing - if (( $G_HW_MODEL >= 10 )); then + if (( $G_HW_MODEL > 9 )); then G_AGI opentyrian @@ -4091,7 +4090,7 @@ _EOF_ DEPS_LIST='ibsdl1.2debian libsdl-net1.2' Download_Install 'https://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip' / - cp -R /usr/local/games/opentyrian /usr/games/ #cp 'just does it', mv will fail if already exists. + cp -R /usr/local/games/opentyrian /usr/games/ # cp 'just does it', mv will fail if already exists. rm -R /usr/local/games/opentyrian chmod +x /usr/games/opentyrian/opentyrian @@ -4099,8 +4098,7 @@ _EOF_ fi - #RPi Cam Control - software_id=59 + software_id=59 # RPi Cam Control if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4165,7 +4163,7 @@ _EOF_ #Download_Install 'https://github.com/ArturSierzant/OMPD/archive/master.zip' /var/www Download_Install 'https://github.com/ArturSierzant/OMPD/archive/2a2909be2d7abc8cce7dff741f529c7d876d4094.zip' /var/www - rm -R /var/www/ompd &> /dev/null #Replace/upgrade existing installs + rm -R /var/www/ompd &> /dev/null # Replace/upgrade existing installs mv /var/www/OMPD* /var/www/ompd fi @@ -4268,11 +4266,10 @@ _EOF_ fi - #WEBIOPI requires RPIGPIO + # WebIOPi requires RPi GPIO (( ${aSOFTWARE_INSTALL_STATE[71]} == 1 )) && aSOFTWARE_INSTALL_STATE[69]=1 - #RPIGPIO - software_id=69 + software_id=69 # RPi GPIO if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4280,24 +4277,23 @@ _EOF_ fi - #WIRINGPI - software_id=70 + software_id=70 # WebIOPi if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - RPi + # RPi if (( $G_HW_MODEL < 10 )); then - # https://git.drogon.net/?p=wiringPi;a=shortlog;h=refs/heads/master snapshot + # https://git.drogon.net/?p=wiringPi;a=shortlog;h=refs/heads/master snapshot Download_Install 'https://dietpi.com/downloads/binaries/all/wiringPi-8d188fa.tar.gz' - # - Odroid's + # Odroids elif (( $G_HW_MODEL < 20 )); then Download_Install 'https://github.com/hardkernel/wiringPi/archive/master.zip' - # - BPiPro + # BPi Pro elif (( $G_HW_MODEL == 51 )); then Download_Install 'https://github.com/LeMaker/WiringBP/archive/bananapro.zip' @@ -4316,8 +4312,7 @@ _EOF_ fi - #RPII2C - software_id=72 + software_id=72 # RPi I2C if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4325,8 +4320,7 @@ _EOF_ fi - #nodered - software_id=122 + software_id=122 # Node-RED if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4341,8 +4335,7 @@ _EOF_ fi - #mosquitto - software_id=123 + software_id=123 # Mosquitto if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4358,7 +4351,19 @@ _EOF_ INSTALL_URL_ADDRESS='https://api.github.com/repos/blynkkk/blynk-server/releases/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url' | cut -d \" -f 4) + # On Buster use non-Java8 binary, else Java 8 + local java='java8' + (( $G_DISTRO > 4 )) && java='[^a].' # Exclude "a" von jav[a]8 but allow "8" as this can be from version string + INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*$java\.jar" | cut -d \" -f 4) + + # Fallback URL + if [[ ! $INSTALL_URL_ADDRESS ]]; then + + INSTALL_URL_ADDRESS='https://github.com/blynkkk/blynk-server/releases/download/v0.41.5/server-0.41.5-java8.jar' + (( $G_DISTRO > 4 )) && INSTALL_URL_ADDRESS='https://github.com/blynkkk/blynk-server/releases/download/v0.41.5/server-0.41.5-java8.jar' + + fi + mkdir -p $G_FP_DIETPI_USERDATA/blynk/data G_THREAD_START wget "$INSTALL_URL_ADDRESS" -O $G_FP_DIETPI_USERDATA/blynk/blynkserver.jar @@ -4371,20 +4376,19 @@ _EOF_ fi - #NAA Daemon - software_id=124 + software_id=124 # NAA Daemon if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - Skip license for NAA daemon: + # Skip license for NAA daemon debconf-set-selections <<< 'networkaudiod networkaudiod/license note false' # Packages local apackages=() - # - Jessie - requires stretch packages - if (( $G_DISTRO == 3 )); then + # - Jessie: Requires Stretch packages + if (( $G_DISTRO < 4 )); then apackages+=('https://dietpi.com/downloads/binaries/all/gcc-6-base_6.3.0-6_armhf.deb') apackages+=('https://dietpi.com/downloads/binaries/all/libstdc++6_6.3.0-6_armhf.deb') @@ -4392,7 +4396,7 @@ _EOF_ fi # - ARMv6/7 - if (( $G_HW_ARCH <= 2 )); then + if (( $G_HW_ARCH < 3 )); then apackages+=('https://www.signalyst.eu/bins/naa/linux/stretch/networkaudiod_3.5.5-39_armhf.deb') @@ -4408,24 +4412,24 @@ _EOF_ fi - # - Check online - for ((i=0; i<${#apackages[@]}; i++)) + # Check online + for i in "${apackages[@]}" do - G_CHECK_URL "${apackages[$i]}" + G_CHECK_URL "$i" done - # - Prereqs + # Pre-reqs DEPS_LIST='libasound2' # - Stretch+ additional packages (( $G_DISTRO > 3 )) && DEPS_LIST+=' gcc-6-base libstdc++6' - for ((i=0; i<${#apackages[@]}; i++)) + for i in "${apackages[@]}" do - no_check_url=1 Download_Install "${apackages[$i]}" + no_check_url=1 Download_Install "$i" done @@ -4436,8 +4440,7 @@ _EOF_ fi - #Tomcat8 - software_id=125 + software_id=125 # Tomcat8 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4445,8 +4448,7 @@ _EOF_ fi - #WEBIOPI - software_id=71 + software_id=71 # WebIOPi if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4469,20 +4471,18 @@ _EOF_ fi - #DIETPICLOUDSHELL - software_id=62 + software_id=62 # DietPi-CloudShell if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #LCD panels can be enabled in Dietpi-config > display options - # XU4 enable cloudshell + # LCD panels can be enabled in Dietpi-config > display options + # - XU4 enable cloudshell (( $G_HW_MODEL == 11 )) && /DietPi/dietpi/func/dietpi-set_hardware lcdpanel odroid-cloudshell fi - #HAPROXY - software_id=98 + software_id=98 # HAProxy if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4530,8 +4530,7 @@ _EOF_ fi - #WORDPRESS - software_id=55 + software_id=55 # Wordpress if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4552,8 +4551,7 @@ _EOF_ fi - #TIGHTVNCSERVER - software_id=27 + software_id=27 # TightVNC Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4561,32 +4559,26 @@ _EOF_ fi - #VNC4SERVER - software_id=28 + software_id=28 # VNC4 Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing local package_list='vnc4server x11vnc' - # - Stretch+ - if (( $G_DISTRO >= 4 )); then - - package_list+=' tigervnc-common' - - fi + # Stretch+ + (( $G_DISTRO > 3 )) && package_list+=' tigervnc-common' G_AGI $package_list fi - #REALVNCSERVER - software_id=120 + software_id=120 # RealVNC Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - Available in Raspbian apt + # Available in Raspbian APT repo G_AGI realvnc-vnc-server fi @@ -4677,8 +4669,7 @@ _EOF_ fi - #PHPSYSINFO - software_id=64 + software_id=64 # phpSysInfo if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4688,8 +4679,7 @@ _EOF_ fi - #Ubooquity - software_id=80 + software_id=80 # Ubooquity if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4702,8 +4692,7 @@ _EOF_ fi - #PHPIMAGEGALLERY - software_id=56 + software_id=56 # PHP Image Gallery if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4711,8 +4700,7 @@ _EOF_ fi - #AMPACHE - software_id=40 + software_id=40 # Ampache if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4735,8 +4723,7 @@ _EOF_ fi - #OPENVPNSERVER - software_id=97 + software_id=97 # OpenVPN Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4744,8 +4731,7 @@ _EOF_ fi - #PiVPN - software_id=117 + software_id=117 # PiVPN if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4755,14 +4741,14 @@ _EOF_ G_AGI lsb-release iptables-persistent dnsutils expect net-tools openvpn - # - Requires underpriv user: https://github.com/MichaIng/DietPi/issues/570#issuecomment-255588307 + # Requires underpriv user: https://github.com/MichaIng/DietPi/issues/570#issuecomment-255588307 useradd pivpn mkdir -p /home/pivpn wget "$INSTALL_URL_ADDRESS" -O pivpn_install.sh chmod +x pivpn_install.sh - # - Disable reboot + # Disable reboot sed -i '/shutdown[[:space:]]/d' pivpn_install.sh until ./pivpn_install.sh @@ -4798,8 +4784,8 @@ _EOF_ kernel_packages='raspberrypi-bootloader raspberrypi-kernel libraspberrypi-bin libraspberrypi0 raspberrypi-kernel-headers' - #Odroid C1 - elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then #REMOVE v6.24 + # - Odroid C1: REMOVE v6.24 + elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then kernel_packages='linux-image-armhf-odroid-c1 linux-headers-armhf-odroid-c1' @@ -4896,7 +4882,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior else # - Remove/Update existing certbot installer scripts - [[ -d /etc/certbot_scripts ]] && rm -R /etc/certbot_scripts + [[ -d '/etc/certbot_scripts' ]] && rm -R /etc/certbot_scripts Download_Install 'https://github.com/certbot/certbot/archive/master.zip' /etc mv /etc/certbot* /etc/certbot_scripts @@ -4973,8 +4959,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #SHAIRPORTSYNC - software_id=37 + software_id=37 # Shairport-Sync if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4988,8 +4973,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #PYDIO - software_id=48 + software_id=48 # Pydio if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5015,8 +4999,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #SQUEEZELITE - software_id=36 + software_id=36 # SqueezeLite if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5054,8 +5037,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #EMONHUB - software_id=99 + software_id=99 # EmonHub if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5065,14 +5047,13 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior pip install paho-mqtt pydispatcher - # - move everything to /etc/emonhub + # Move everything to /etc/emonhub rm -R /etc/emonhub mv emonhub-* /etc/emonhub fi - #RPIMONITOR - software_id=66 + software_id=66 # RPi Monitor if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5100,8 +5081,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #BAIKAL - software_id=57 + software_id=57 # BaiKal if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5111,8 +5091,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #MUMBLESERVER - software_id=43 + software_id=43 # Mumble Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5229,8 +5208,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #GOGS - software_id=49 + software_id=49 # Gogs if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5258,8 +5236,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #QBITTORRENT - software_id=46 + software_id=46 # qBitTorrent if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5352,7 +5329,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #Web interface + # Web interface Download_Install 'https://github.com/ziahamza/webui-aria2/archive/master.zip' cp -R webui-aria2* /var/www/aria2 @@ -5360,8 +5337,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #Medusa - software_id=116 + software_id=116 # Medusa if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5384,13 +5360,12 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #SYNCTHING - software_id=50 + software_id=50 # Syncthing if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - if [[ -d /etc/syncthing ]]; then + if [[ -d '/etc/syncthing' ]]; then G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} install dir \"/etc/syncthing\" already exists. Download and install steps will be skipped. - If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use the internal updater from WebUI. @@ -5425,8 +5400,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #TONIDO - software_id=134 + software_id=134 # Tonido if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5459,17 +5433,16 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #CHROMIUM - software_id=113 + software_id=113 # Chromium if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #Pre-Req's + # Pre-reqs G_AG_CHECK_INSTALL_PREREQ lsb-release - #Stretch via apt - if (( $G_DISTRO >= 4 )); then + # Stretch+ via APT + if (( $G_DISTRO > 3 )); then if (( $G_HW_MODEL < 10 )); then @@ -5483,19 +5456,19 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior else - #armv6+ + # ARMv6/7 if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/chromium_52.0.2743.116-1-deb8u1.1_armhf.deb' - #ARMv8 + # ARMv8 elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/chromium_52.0.2743.116-1-deb8u1.1_arm64.deb' fi - # - Odroid's, 'apt-get install -f' removes chromium package, rather than install required deps... + # Odroids, 'apt-get -f install' removes chromium package, rather than install required deps... if (( $G_HW_MODEL > 9 && $G_HW_MODEL < 20 )); then DEPS_LIST='libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7' @@ -5506,27 +5479,26 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior Download_Install 'https://dietpi.com/downloads/binaries/all/chromium-l10n_52.0.2743.116-1-deb8u1.1_all.deb' - # armv6+ + # ARMv6/7 if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then Download_Install 'https://dietpi.com/downloads/binaries/all/chromedriver_52.0.2743.116-1-deb8u1.1_armhf.deb' - # arm64 + # ARMv8 elif (( $G_HW_ARCH == 3 )); then Download_Install 'https://dietpi.com/downloads/binaries/all/chromedriver_52.0.2743.116-1-deb8u1.1_arm64.deb' fi - # - Prevent Debian repo from replacing our chromium packages: https://github.com/MichaIng/DietPi/issues/658 + # Prevent Debian repo from replacing our chromium packages: https://github.com/MichaIng/DietPi/issues/658 apt-mark hold chromium chromedriver fi fi - #MotionEye - software_id=136 + software_id=136 # MotionEye if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5607,6 +5579,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior # Pre-reqs DEPS_LIST='par2 p7zip-full' + # - Pre-compiling required on ARM + (( $G_HW_ARCH < 10 )) && DEPS_LIST+=' libffi-dev libssl-dev' Download_Install 'https://github.com/sabnzbd/sabnzbd/archive/master.zip' @@ -5627,21 +5601,19 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #spotifyconnectweb - software_id=141 + software_id=141 # Spotify Connect Web if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - INSTALL_URL_ADDRESS='https://github.com/Fornoth/spotify-connect-web/releases' #full path fails wget spider test... + INSTALL_URL_ADDRESS='https://github.com/Fornoth/spotify-connect-web/releases' # Full path fails wget spider test... G_CHECK_URL "$INSTALL_URL_ADDRESS" no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS/download/0.0.4-alpha/spotify-connect-web_0.0.4-alpha.tar.gz" $G_FP_DIETPI_USERDATA fi - #couchpotato - software_id=142 + software_id=142 # CouchPotato if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5656,8 +5628,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #Koel - software_id=143 + software_id=143 # Koel if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5764,38 +5735,80 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #Jackett - software_id=147 + software_id=147 # Jackett if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing + # Grab latest version download link INSTALL_URL_ADDRESS='https://api.github.com/repos/Jackett/Jackett/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" #full filepath below, returns --spider error :( + G_CHECK_URL "$INSTALL_URL_ADDRESS" + + # - ARMv6: Requires mono: https://github.com/Jackett/Jackett#installation-on-linux-armv6-or-below INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*Jackett\.Binaries\.Mono\.tar\.gz' | cut -d \" -f 4) + fallback_url='https://github.com/Jackett/Jackett/releases/download/v0.11.295/Jackett.Binaries.Mono.tar.gz' + + # - ARMv7 + if (( $G_HW_ARCH == 2 )); then + + INSTALL_URL_ADDRESS=${INSTALL_URL_ADDRESS/Mono/LinuxARM32} + fallback_url=${fallback_url/Mono/LinuxARM32} + # - ARMv8 + elif (( $G_HW_ARCH == 3 )); then + + INSTALL_URL_ADDRESS=${INSTALL_URL_ADDRESS/Mono/LinuxARM64} + fallback_url=${fallback_url/Mono/LinuxARM64} + + # - x86_64 + elif (( $G_HW_ARCH == 10 )); then + + INSTALL_URL_ADDRESS=${INSTALL_URL_ADDRESS/Mono/LinuxAMDx64} + fallback_url=${fallback_url/Mono/LinuxAMDx64} + + fi + + # Standalone version dependencies: https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore30#linux-distribution-dependencies + if (( $G_HW_ARCH != 1 )); then + + DEPS_LIST='liblttng-ust0' + if (( $G_DISTRO < 4 )); then + + DEPS_LIST+=' libicu52' + + elif (( $G_DISTRO == 4 )); then + + DEPS_LIST+=' libicu57' + + elif (( $G_DISTRO > 4 )); then + + DEPS_LIST+=' libicu63' + + fi + + fi + + # Download: wget --spider/curl -LI return 403 no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt # Move existing configs to unpacked install dir - [[ -d /opt/jackett/.mono ]] && mv /opt/jackett/.mono /opt/Jackett/ - [[ -d /opt/jackett/.config ]] && mv /opt/jackett/.config /opt/Jackett/ + [[ -d '/opt/jackett/Jackett' ]] && mv /opt/jackett/Jackett /opt/Jackett/ + [[ -d '/opt/jackett/.mono' ]] && mv /opt/jackett/.mono /opt/Jackett/ # Remove existing install dir - [[ -d /opt/jackett ]] && rm -R /opt/jackett + [[ -d '/opt/jackett' ]] && rm -R /opt/jackett # Move unpacked install dir in place mv /opt/Jackett /opt/jackett fi - #NZBget - software_id=149 + software_id=149 # NZBget if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing INSTALL_URL_ADDRESS='https://nzbget.net' - G_CHECK_URL "$INSTALL_URL_ADDRESS" INSTALL_URL_ADDRESS+='/download/nzbget-latest-bin-linux.run' @@ -5807,33 +5820,30 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #------------------ Bittorrent: HTPC Manager ------------------ - software_id=155 + software_id=155 # HTPC Manager if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing INSTALL_URL_ADDRESS='https://github.com/Hellowlol/HTPC-Manager.git' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install Python and PIP - G_AGI python python-pip python-imaging python-dev + # Pre-reqs + G_AGI python-imaging git clone --depth=1 "$INSTALL_URL_ADDRESS" - # - Move HTPC Manager to a 'better' location + # Move HTPC Manager to a 'better' location mkdir -p $G_FP_DIETPI_USERDATA/htpc-manager cp -R HTPC-Manager/* $G_FP_DIETPI_USERDATA/htpc-manager/ rm -R HTPC-Manager - # - psutil for system stats + # psutil for system stats pip install psutil fi - #OctoPrint - software_id=153 + software_id=153 # OctoPrint if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5843,7 +5853,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior G_THREAD_START git clone "$INSTALL_URL_ADDRESS" - G_AGI python python-dev libjpeg-dev + G_AGI libjpeg-dev G_THREAD_WAIT mv OctoPrint* $G_FP_DIETPI_USERDATA/octoprint @@ -5891,8 +5901,7 @@ If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use it's inte fi - #Minio - software_id=158 + software_id=158 # Minio if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5909,32 +5918,29 @@ If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use it's inte INSTALL_URL_ADDRESS='https://dl.minio.io/server/minio/release/linux-arm/minio' fi - G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Download executable - [ -d /usr/local/bin ] || mkdir /usr/local/bin - wget -O /usr/local/bin/minio $INSTALL_URL_ADDRESS + # Download executable + [[ -d '/usr/local/bin' ]] || mkdir -p /usr/local/bin + wget -O /usr/local/bin/minio "$INSTALL_URL_ADDRESS" chmod +x /usr/local/bin/minio # Check, Download, Install startup script INSTALL_URL_ADDRESS='https://github.com/minio/minio-service/raw/master/linux-systemd/minio.service' - G_CHECK_URL "$INSTALL_URL_ADDRESS" # Download the systemd service script - wget -O /etc/systemd/system/minio.service $INSTALL_URL_ADDRESS + wget -O /etc/systemd/system/minio.service "$INSTALL_URL_ADDRESS" # Create no login, with home directory, with group of same name, user to run Minio in adduser --system --group minio-user # Create default data directory & grant minio-user proper access - mkdir $G_FP_DIETPI_USERDATA/minio-data + mkdir -p $G_FP_DIETPI_USERDATA/minio-data fi - #Docker - software_id=162 + software_id=162 # Docker if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -5956,8 +5962,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #FuguHub - software_id=161 + software_id=161 # FuguHub if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6003,22 +6008,22 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix INSTALL_URL_ADDRESS='https://dl.gitea.io/gitea/1.7/gitea-1.7-' - #armv6 + # armv6 if (( $G_HW_ARCH == 1 )); then INSTALL_URL_ADDRESS+='linux-arm-6' - #armv7 + # armv7 elif (( $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='linux-arm-7' - #armv8 + # armv8 elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='linux-arm64' - #x86_64 + # x86_64 elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='linux-amd64' @@ -6027,7 +6032,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix G_CHECK_URL "$INSTALL_URL_ADDRESS" - # - Data storage / user data + # Data storage / user data mkdir -p $G_FP_DIETPI_USERDATA/gitea/gitea-repositories wget "$INSTALL_URL_ADDRESS" -O $G_FP_DIETPI_USERDATA/gitea/gitea @@ -6112,8 +6117,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Google AIY - software_id=169 + software_id=169 # Google AIY if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6129,11 +6133,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix env/bin/pip install -r requirements.txt #??? ARMv7 only - if (( $G_HW_ARCH == 2 )); then - - env/bin/pip install google-assistant-library==0.0.3 - - fi + (( $G_HW_ARCH == 2 )) && env/bin/pip install google-assistant-library==0.0.3 # - Services sed -i "s#/home/pi#$G_FP_DIETPI_USERDATA#g" systemd/voice-recognizer.service @@ -6152,8 +6152,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Roon Extension Manager - software_id=86 + software_id=86 # Roon Extension Manager if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6179,7 +6178,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix local software_id=-1 - software_id=5 + software_id=5 # ALSA if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6202,14 +6201,13 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #LibSSL1.0.0 - software_id=126 + software_id=126 # LibSSL1.0.0 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # - Stretch, libssl1.0.0 no longer available: https://github.com/MichaIng/DietPi/issues/1299 - if (( $G_DISTRO >= 4 )); then + # - Stretch+, libssl1.0.0 no longer available: https://github.com/MichaIng/DietPi/issues/1299 + if (( $G_DISTRO > 3 )); then INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/' @@ -6230,18 +6228,19 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi + DEPS_LIST='multiarch-support' Download_Install "$INSTALL_URL_ADDRESS" fi fi - software_id=6 + software_id=6 # Xserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #Xserver Prereqs (ALL) + # Xserver Prereqs (ALL) G_AGI xserver-xorg xinit xcompmgr xterm dbus-x11 xfonts-base x11-xserver-utils x11-utils libgl1-mesa-dri mesa-utils mesa-utils-extra G_BACKUP_FP /etc/X11/xorg.conf @@ -6252,37 +6251,36 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix # - Disable DPMS and all screen blanking dps_index=$software_id Download_Install '99-dietpi-dpms_off.conf' /etc/X11/xorg.conf.d/99-dietpi-dpms_off.conf - #RPI + # RPI if (( $G_HW_MODEL < 10 )); then : - #Odroid N1 + # Odroid N1 elif (( $G_HW_MODEL == 14 )); then DEPS_LIST='libmali-rk-midgard-t86x-r14p0 xserver-xorg-video-armsoc-rk3399-odroid' dps_index=$software_id Download_Install 'xorg_n1.conf' /etc/X11/xorg.conf - #Odroid C2 + # Odroid C2 elif (( $G_HW_MODEL == 12 )); then DEPS_LIST='aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid xf86-video-fbturbo-odroid' dps_index=$software_id Download_Install 'xorg_c2.conf' /etc/X11/xorg.conf - #Odroid XU4 + # Odroid XU4 elif (( $G_HW_MODEL == 11 )); then G_AGI firmware-samsung xf86-video-armsoc-odroid malit628-odroid #dps_index=$software_id Download_Install 'xorg_xu4.conf' /etc/X11/xorg.conf - #Odroid C1 - #REMOVE v6.24 + # Odroid C1: REMOVE v6.24 elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then DEPS_LIST='aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid' dps_index=$software_id Download_Install 'xorg_c1.conf' /etc/X11/xorg.conf - #Pine64 + # Pine64 elif (( $G_HW_MODEL == 40 )); then Download_Install 'https://dietpi.com/downloads/binaries/all/libump_1-1_arm64.deb' @@ -6291,32 +6289,32 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix dps_index=$software_id Download_Install 'xorg_pine64.conf' /etc/X11/xorg.conf - #RK3399 + # RK3399 # elif (( $G_HW_MODEL == 42 || $G_HW_MODEL == 68 )); then - #/usr/lib/xorg/Xorg: symbol lookup error: /usr/lib/xorg/modules/libglamoregl.so: undefined symbol: gbm_create_device - #Retry with kernel/uboot from Ubuntu image??? - - # dps_index=$software_id Download_Install 'xorg_rk3399.conf' /etc/X11/xorg.conf - # dps_index=$software_id Download_Install '50-dietpi-rk3399.rules' /etc/udev/rules.d/50-rk3399.rules - - ## wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-x11-fbdev.so -O /usr/lib/aarch64-linux-gnu/libMali.so - ## wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-fbdev.so -O /usr/lib/aarch64-linux-gnu/libMali.so - ## wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-gbm.so -O /usr/lib/aarch64-linux-gnu/libMali.so #works but no GLES - # wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0.so -O /usr/lib/aarch64-linux-gnu/libMali.so - # rm $(ls /usr/lib/aarch64-linux-gnu/libGLESv2.*) - # rm $(ls /usr/lib/aarch64-linux-gnu/libEGL.*) - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libEGL.so.1 - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libEGL.so.1.0.0 - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libGLESv2.so.2 - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libGLESv2.so.2.0.0 - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libgbm.so.1 - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libgbm.so.1.0.0 - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libmali.so - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libMaliOpenCL.so - # ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libOpenCL.so - - #ASUS TB + # /usr/lib/xorg/Xorg: symbol lookup error: /usr/lib/xorg/modules/libglamoregl.so: undefined symbol: gbm_create_device + # Retry with kernel/uboot from Ubuntu image??? + + #dps_index=$software_id Download_Install 'xorg_rk3399.conf' /etc/X11/xorg.conf + #dps_index=$software_id Download_Install '50-dietpi-rk3399.rules' /etc/udev/rules.d/50-rk3399.rules + + ##wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-x11-fbdev.so -O /usr/lib/aarch64-linux-gnu/libMali.so + ##wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-fbdev.so -O /usr/lib/aarch64-linux-gnu/libMali.so + ##wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-gbm.so -O /usr/lib/aarch64-linux-gnu/libMali.so #works but no GLES + #wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0.so -O /usr/lib/aarch64-linux-gnu/libMali.so + #rm $(ls /usr/lib/aarch64-linux-gnu/libGLESv2.*) + #rm $(ls /usr/lib/aarch64-linux-gnu/libEGL.*) + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libEGL.so.1 + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libEGL.so.1.0.0 + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libGLESv2.so.2 + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libGLESv2.so.2.0.0 + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libgbm.so.1 + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libgbm.so.1.0.0 + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libmali.so + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libMaliOpenCL.so + #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libOpenCL.so + + # ASUS TB elif (( $G_HW_MODEL == 52 )); then Download_Install 'https://dietpi.com/downloads/binaries/asus/ASUSTB_GPU.7z' gpu_driver @@ -6350,8 +6348,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Nvidia driver - software_id=151 + software_id=151 # Nvidia driver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6360,8 +6357,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Avahi-Daemon - software_id=152 + software_id=152 # Avahi-Daemon if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6369,7 +6365,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - software_id=16 + software_id=16 # Build essentials if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6385,7 +6381,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - software_id=17 + software_id=17 # Git client if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6510,7 +6506,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Banner_Installing - #Remove Information file + # Remove Information file rm /mnt/samba/readme.txt &> /dev/null G_AGI smbclient cifs-utils @@ -6632,7 +6628,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Banner_Installing - #Workaround for dpkg failure on 1st install if service is already running but APT not installed: https://github.com/MichaIng/DietPi/pull/2277/#issuecomment-441460925 + # Workaround for dpkg failure on 1st install if service is already running but APT not installed: https://github.com/MichaIng/DietPi/pull/2277/#issuecomment-441460925 systemctl stop rsyslog &> /dev/null G_AGI rsyslog systemctl start rsyslog &> /dev/null @@ -6768,7 +6764,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF - #RPi's + ARMv6 only available in raspbian repo: https://github.com/MichaIng/DietPi/issues/1023 + # RPi's + ARMv6 only available in raspbian repo: https://github.com/MichaIng/DietPi/issues/1023 if (( $G_HW_MODEL < 10 || $G_HW_ARCH == 1 )); then echo "deb https://download.mono-project.com/repo/debian raspbian$G_DISTRO_NAME main" > /etc/apt/sources.list.d/mono-xamarin.list @@ -6788,8 +6784,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #------------------ Home Automation: Home Assistant ------------------ - software_id=157 + software_id=157 # Home Assistant if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6853,16 +6848,15 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Unrar - software_id=170 + software_id=170 # Unrar if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #Raspbian "unrar-free" only available in repos + # Raspbian "unrar-free" only available in repos if (( $G_HW_MODEL < 10 )); then - #G_AGI unrar-free #Does not support all rar formats, better use "unrar-nonfree" from Debian repo + #G_AGI unrar-free # Does not support all rar formats, better use "unrar-nonfree" from Debian repo Download_Install "https://dietpi.com/downloads/binaries/rpi/unrar-armhf-$G_DISTRO_NAME.deb" else @@ -6882,8 +6876,8 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Apply_SSHServer_Choices(){ - #Work out which SSH server needs installing from IDs (if any) - #Work out which SSH server needs removing (if any) + # Work out which SSH server needs installing from IDs (if any) + # Work out which SSH server needs removing (if any) if (( $INDEX_SSHSERVER_TARGET != $INDEX_SSHSERVER_CURRENT )); then # - No SSH server @@ -6913,26 +6907,26 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Apply_FileServer_Choices(){ - #Work out which File Server needs installing from IDs (if any) - #Work out which File server needs removing (if any) + # Work out which File Server needs installing from IDs (if any) + # Work out which File server needs removing (if any) if (( $INDEX_FILESERVER_TARGET != $INDEX_FILESERVER_CURRENT )); then # Run uninstall of old file servers, after install loop UNINSTALL_REQUIRED=1 - #No File server + # No File server if (( $INDEX_FILESERVER_TARGET == 0 )); then (( ${aSOFTWARE_INSTALL_STATE[94]} == 2 )) && aSOFTWARE_INSTALL_STATE[94]=-1 (( ${aSOFTWARE_INSTALL_STATE[96]} == 2 )) && aSOFTWARE_INSTALL_STATE[96]=-1 - #ProFTP + # ProFTP elif (( $INDEX_FILESERVER_TARGET == -1 )); then aSOFTWARE_INSTALL_STATE[94]=1 (( ${aSOFTWARE_INSTALL_STATE[96]} == 2 )) && aSOFTWARE_INSTALL_STATE[96]=-1 - #Samba + # Samba elif (( $INDEX_FILESERVER_TARGET == -2 )); then aSOFTWARE_INSTALL_STATE[96]=1 @@ -6940,7 +6934,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Update Current SSHSERVER index + # Update Current SSHSERVER index INDEX_FILESERVER_CURRENT=$INDEX_FILESERVER_TARGET fi @@ -6949,35 +6943,35 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Apply_Logging_Choices(){ - #Work out which Logging system needs installing from IDs (if any) - #Work out which Logging system needs removing (if any) + # Work out which Logging system needs installing from IDs (if any) + # Work out which Logging system needs removing (if any) if (( $INDEX_LOGGING_TARGET != $INDEX_LOGGING_CURRENT )); then # Run uninstall of old logging systems, after install loop UNINSTALL_REQUIRED=1 - #None + # None if (( $INDEX_LOGGING_TARGET == 0 )); then (( ${aSOFTWARE_INSTALL_STATE[101]} == 2 )) && aSOFTWARE_INSTALL_STATE[101]=-1 (( ${aSOFTWARE_INSTALL_STATE[102]} == 2 )) && aSOFTWARE_INSTALL_STATE[102]=-1 (( ${aSOFTWARE_INSTALL_STATE[103]} == 2 )) && aSOFTWARE_INSTALL_STATE[103]=-1 - #Ramlog - clear every hour + # Ramlog - clear every hour elif (( $INDEX_LOGGING_TARGET == -1 )); then aSOFTWARE_INSTALL_STATE[103]=1 (( ${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 /root/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 (( ${aSOFTWARE_INSTALL_STATE[101]} == 2 )) && aSOFTWARE_INSTALL_STATE[101]=-1 (( ${aSOFTWARE_INSTALL_STATE[102]} == 2 )) && aSOFTWARE_INSTALL_STATE[102]=-1 - #Logrotate + rsyslog - logs to disk + # Logrotate + rsyslog - logs to disk elif (( $INDEX_LOGGING_TARGET == -3 )); then aSOFTWARE_INSTALL_STATE[101]=1 @@ -6986,7 +6980,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #Update Current Logging index + # Update Current Logging index INDEX_LOGGING_CURRENT=$INDEX_LOGGING_TARGET fi @@ -7033,17 +7027,17 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix 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 + [[ -f '/usr/share/applications/lxrandr.desktop' ]] && rm /usr/share/applications/lxrandr.desktop # - Disable Trash G_CONFIG_INJECT 'use_trash=' 'use_trash=0' /etc/xdg/libfm/libfm.conf # - Firefox optimizations # ??? These keep adding new entries, ignore existing entry??? - # G_CONFIG_INJECT 'extensions.update.enabled' 'pref("extensions.update.enabled", false);' /etc/firefox-esr/firefox-esr.js - # G_CONFIG_INJECT 'datareporting.healthreport.uploadEnabled' 'pref("datareporting.healthreport.uploadEnabled", false);' /etc/firefox-esr/firefox-esr.js - # G_CONFIG_INJECT 'browser.cache.disk.parent_directory' 'pref("browser.cache.disk.parent_directory", "/tmp/firefox_cache");' /etc/firefox-esr/firefox-esr.js - # G_CONFIG_INJECT 'general.smoothScroll' 'pref("general.smoothScroll", false);' /etc/firefox-esr/firefox-esr.js + #G_CONFIG_INJECT 'extensions.update.enabled' 'pref("extensions.update.enabled", false);' /etc/firefox-esr/firefox-esr.js + #G_CONFIG_INJECT 'datareporting.healthreport.uploadEnabled' 'pref("datareporting.healthreport.uploadEnabled", false);' /etc/firefox-esr/firefox-esr.js + #G_CONFIG_INJECT 'browser.cache.disk.parent_directory' 'pref("browser.cache.disk.parent_directory", "/tmp/firefox_cache");' /etc/firefox-esr/firefox-esr.js + #G_CONFIG_INJECT 'general.smoothScroll' 'pref("general.smoothScroll", false);' /etc/firefox-esr/firefox-esr.js G_THREAD_WAIT @@ -7061,10 +7055,10 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Create_Desktop_Shared_Items - # - file manager desktop icon + # File manager desktop icon ln -sf /usr/share/applications/caja.desktop /root/Desktop/caja.desktop - #Odroid C2, define default pulseaudio sink: https://github.com/MichaIng/DietPi/issues/415 + # Odroid C2, define default pulseaudio sink: https://github.com/MichaIng/DietPi/issues/415 if (( $G_HW_MODEL == 12 )); then G_CONFIG_INJECT 'set-default-sink[[:blank:]]' 'set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo' /etc/pulse/default.pa @@ -7078,10 +7072,10 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix Banner_Configuration - # - Configs + # Configs Download_Install "https://github.com/MichaIng/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt/lxqt-$G_DISTRO_NAME.7z" /root/.config - # - Disable trash - # Skip on Buster since trash seems to be implemented differently: https://github.com/MichaIng/DietPi/issues/1918#issuecomment-488085982 + # Disable trash + # - Skip on Buster since trash seems to be implemented differently: https://github.com/MichaIng/DietPi/issues/1918#issuecomment-488085982 (( $G_DISTRO < 5 )) && G_CONFIG_INJECT 'use_trash=' 'use_trash=0' /etc/xdg/libfm/libfm.conf Create_Desktop_Shared_Items @@ -7104,8 +7098,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix fi - #WEBSERVER_APACHE - software_id=83 + software_id=83 # Apache Webserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7166,8 +7159,7 @@ _EOF_ fi - #WEBSERVER_NGINX - software_id=85 + software_id=85 # Nginx Webserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7192,17 +7184,16 @@ _EOF_ fi - #WEBSERVER_LIGHTTPD - software_id=84 + software_id=84 # Lighttpd Webserver if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #www path + # www path G_BACKUP_FP /etc/lighttpd/lighttpd.conf sed -i '/^server.document-root/c\server.document-root = "/var/www"' /etc/lighttpd/lighttpd.conf - #Configure fastcgi for PHP-FPM + # Configure fastcgi for PHP-FPM cat << _EOF_ > /etc/lighttpd/conf-available/15-fastcgi-php.conf # -*- depends: fastcgi -*- # /usr/share/doc/lighttpd/fastcgi.txt.gz @@ -7217,29 +7208,28 @@ fastcgi.server += ( ".php" => ) _EOF_ - #enable cgi/php + # Enable cgi/php lighttpd-enable-mod fastcgi lighttpd-enable-mod fastcgi-php - #Move default page + # Move default page mv /var/www/html/index.lighttpd.html /var/www/ [[ $(ls -A /var/www/html 2>&1) ]] || rm -R /var/www/html fi - #WEBSERVER_PHP - software_id=89 + software_id=89 # PHP if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - # - Apache2 has its own PHP module + # Apache2 has its own PHP module if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then # https://github.com/MichaIng/DietPi/issues/1144 local php_service='/lib/systemd/system/apache2.service' - # - Nginx and Lighttpd use PHP-FPM + # Nginx and Lighttpd use PHP-FPM elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 || ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then local php_service="/lib/systemd/system/${PHP_NAME}-fpm.service" @@ -7332,8 +7322,7 @@ _EOF_ fi - #WEBSERVER_MARIADB - software_id=88 + software_id=88 # MariaDB Database if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7362,8 +7351,7 @@ _EOF_ fi - #WEBSERVER_MYADMINPHP - software_id=90 + software_id=90 # phpMyAdmin if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7384,8 +7372,7 @@ _EOF_ fi - #WEBSERVER_REDIS - software_id=91 + software_id=91 # Redis Database if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7624,7 +7611,7 @@ url.redirect += ( fi # Cal/CardDAV redirects to ownCloud DAV endpoint - if [[ ! -f /etc/nginx/sites-dietpi/dietpi-dav_redirect.conf ]]; then + if [[ ! -f '/etc/nginx/sites-dietpi/dietpi-dav_redirect.conf' ]]; then echo '# Redirect Cal/CardDAV requests to ownCloud endpoint: location = /.well-known/carddav { @@ -7780,7 +7767,7 @@ _EOF_ fi - software_id=114 #N extcloud + software_id=114 # Nextcloud if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7890,7 +7877,7 @@ url.redirect += ( fi # Cal/CardDAV redirects to Nextcloud DAV endpoint - if [[ ! -f /etc/nginx/sites-dietpi/dietpi-dav_redirect.conf ]]; then + if [[ ! -f '/etc/nginx/sites-dietpi/dietpi-dav_redirect.conf' ]]; then echo '# Redirect Cal/CardDAV requests to Nextcloud endpoint: location = /.well-known/carddav { @@ -8088,8 +8075,8 @@ The install script will now exit. After applying one of the the above, rerun die if [[ -f '/lib/systemd/system/coturn.service' ]]; then # - Remove init.d service traces - [[ -f /etc/init.d/coturn ]] && rm /etc/init.d/coturn - [[ -f /etc/default/coturn ]] && rm /etc/default/coturn + [[ -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 @@ -8188,7 +8175,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal G_RUN_CMD systemctl start $MARIADB_SERVICE G_RUN_CMD systemctl start redis-server G_RUN_CMD ncc maintenance:mode --off - [[ -d /var/www/nextcloud/apps/spreed ]] || 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 @@ -8209,9 +8196,9 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal Banner_Configuration - # Remove obsolete init.d service and it's environment file - [[ -f /etc/init.d/transmission-daemon ]] && rm /etc/init.d/transmission-daemon - [[ -f /etc/default/transmission-daemon ]] && rm /etc/default/transmission-daemon + # Remove obsolete init.d service and its environment file + [[ -f '/etc/init.d/transmission-daemon' ]] && rm /etc/init.d/transmission-daemon + [[ -f '/etc/default/transmission-daemon' ]] && rm /etc/default/transmission-daemon # Run service as "dietpi" group: https://github.com/MichaIng/DietPi/issues/350#issuecomment-423763518 mkdir -p /etc/systemd/system/transmission-daemon.service.d @@ -8245,8 +8232,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal fi - #PHPBB - software_id=54 + software_id=54 # phpBB Forum if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8274,12 +8260,12 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal >> $G_FP_DIETPI_USERDATA/.mpd_cache/state >> $G_FP_DIETPI_USERDATA/.mpd_cache/sticker.sql # - Symlink from MPD defaults that applications may still expect/use. - [[ ! -e /var/lib/mpd/music || -L /var/lib/mpd/music ]] || mv -n /var/lib/mpd/music/* $G_FP_DIETPI_USERDATA/Music/ &> /dev/null - [[ ! -e /var/lib/mpd/playlists || -L /var/lib/mpd/playlists ]] || mv -n /var/lib/mpd/playlists/* $G_FP_DIETPI_USERDATA/Music/ &> /dev/null - [[ ! -e /var/lib/mpd/mpd.db || -L /var/lib/mpd/mpd.db ]] || mv -n /var/lib/mpd/mpd.db $G_FP_DIETPI_USERDATA/.mpd_cache/db_file - [[ ! -e /var/lib/mpd/state || -L /var/lib/mpd/state ]] || mv -n /var/lib/mpd/state $G_FP_DIETPI_USERDATA/.mpd_cache/state - [[ ! -e /var/lib/mpd/sticker.sql || -L /var/lib/mpd/sticker.sql ]] || mv -n /var/lib/mpd/sticker.sql $G_FP_DIETPI_USERDATA/.mpd_cache/sticker.sql - [[ -d /var/lib/mpd ]] && rm -R /var/lib/mpd + [[ ! -e '/var/lib/mpd/music' || -L '/var/lib/mpd/music' ]] || mv -n /var/lib/mpd/music/* $G_FP_DIETPI_USERDATA/Music/ &> /dev/null + [[ ! -e '/var/lib/mpd/playlists' || -L '/var/lib/mpd/playlists' ]] || mv -n /var/lib/mpd/playlists/* $G_FP_DIETPI_USERDATA/Music/ &> /dev/null + [[ ! -e '/var/lib/mpd/mpd.db' || -L '/var/lib/mpd/mpd.db' ]] || mv -n /var/lib/mpd/mpd.db $G_FP_DIETPI_USERDATA/.mpd_cache/db_file + [[ ! -e '/var/lib/mpd/state' || -L '/var/lib/mpd/state' ]] || mv -n /var/lib/mpd/state $G_FP_DIETPI_USERDATA/.mpd_cache/state + [[ ! -e '/var/lib/mpd/sticker.sql' || -L '/var/lib/mpd/sticker.sql' ]] || mv -n /var/lib/mpd/sticker.sql $G_FP_DIETPI_USERDATA/.mpd_cache/sticker.sql + [[ -d '/var/lib/mpd' ]] && rm -R /var/lib/mpd mkdir -p /var/lib/mpd ln -sf $G_FP_DIETPI_USERDATA/Music /var/lib/mpd/music ln -sf $G_FP_DIETPI_USERDATA/Music /var/lib/mpd/playlists @@ -8299,7 +8285,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal fi # MPD service/confs - [[ -f /etc/default/mpd ]] && rm /etc/default/mpd + [[ -f '/etc/default/mpd' ]] && rm /etc/default/mpd # - Upsteam systemd unit: https://github.com/MusicPlayerDaemon/MPD/blob/master/systemd/system/mpd.service.in # - Debian package systemd unit: https://deb.debian.org/debian/pool/main/m/mpd/ @@ -8375,8 +8361,7 @@ _EOF_ fi - # Proftpd - software_id=94 + software_id=94 # ProFTPD if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8388,8 +8373,7 @@ _EOF_ fi - #Samba Server - software_id=96 + software_id=96 # Samba Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8404,8 +8388,7 @@ _EOF_ fi - #vsFTPD - software_id=95 + software_id=95 # vsFTPD if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8420,8 +8403,7 @@ _EOF_ fi - #NFS_SERVER - software_id=109 + software_id=109 # NFS Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8432,8 +8414,7 @@ _EOF_ fi - #YMPD - software_id=32 + software_id=32 # ympd if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8459,8 +8440,7 @@ _EOF_ fi - #myMPD - software_id=148 + software_id=148 # myMPD if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8490,18 +8470,17 @@ _EOF_ mkdir -p /var/lib/mympd/smartpls /var/lib/mympd/tmp - #symlink music/libary folders used by mympd + # Symlink music/libary folders used by mympd if [[ $(readlink /usr/share/mympd/htdocs/library) != $G_FP_DIETPI_USERDATA/Music ]]; then - [[ -d /usr/share/mympd/htdocs/library ]] && rm -R /usr/share/mympd/htdocs/library + [[ -d '/usr/share/mympd/htdocs/library' ]] && rm -R /usr/share/mympd/htdocs/library ln -sf $G_FP_DIETPI_USERDATA/Music /usr/share/mympd/htdocs/library fi fi - #Roon Bridge - software_id=121 + software_id=121 # Roon Bridge if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8554,8 +8533,7 @@ _EOF_ fi - #Tomcat8 - software_id=125 + software_id=125 # Tomcat8 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8563,8 +8541,7 @@ _EOF_ fi - #CAVA - software_id=119 + software_id=119 # CAVA if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8599,8 +8576,7 @@ _EOF_ fi - #Mopidy - software_id=118 + software_id=118 # Mopidy if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8610,7 +8586,7 @@ _EOF_ G_CONFIG_INJECT 'cache_dir[[:blank:]]*=' 'cache_dir = /mnt/dietpi_userdata/mopidy/cache' /etc/mopidy/mopidy.conf '\[core\]' # - Move existing home+data to dietpi_userdata, if not yet existent - if [[ -d /var/lib/mopidy && ! -d $G_FP_DIETPI_USERDATA/mopidy ]]; then + if [[ -d '/var/lib/mopidy' && ! -d $G_FP_DIETPI_USERDATA/mopidy ]]; then mv /var/lib/mopidy $G_FP_DIETPI_USERDATA/mopidy mkdir -p $G_FP_DIETPI_USERDATA/mopidy/data @@ -8625,7 +8601,7 @@ _EOF_ fi # - Move existing cache to dietpi_userdata, if not yet existent - if [[ -d /var/cache/mopidy && ! -d $G_FP_DIETPI_USERDATA/mopidy/cache ]]; then + if [[ -d '/var/cache/mopidy' && ! -d $G_FP_DIETPI_USERDATA/mopidy/cache ]]; then mv /var/cache/mopidy $G_FP_DIETPI_USERDATA/mopidy/cache @@ -8656,7 +8632,7 @@ _EOF_ userdel -r kodi &> /dev/null #Run Kodi as root - [[ -f /etc/default/kodi ]] && G_CONFIG_INJECT 'USER=' 'USER=root' /etc/default/kodi + [[ -f '/etc/default/kodi' ]] && G_CONFIG_INJECT 'USER=' 'USER=root' /etc/default/kodi #Copy udev rules, probably not needed for root, but we'll do it anyway dps_index=$software_id Download_Install '99-dietpi-kodi.rules' /etc/udev/rules.d/99-dietpi-kodi.rules @@ -8664,14 +8640,13 @@ _EOF_ #Create .desktop SymLinks mkdir -p /root/Desktop - [[ -f /usr/share/applications/kodi.desktop ]] && rm /usr/share/applications/kodi.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 /root/Desktop/kodi.desktop fi - #MINIDLNA - software_id=39 + software_id=39 # MiniDLNA if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8714,10 +8689,10 @@ _EOF_ Banner_Configuration - #Failsafe: Directory required for "noip2 -C" to create the config file + # Failsafe: Directory required for "noip2 -C" to create the config file mkdir -p /usr/local/etc - #noip2 service file + # noip2 service file cat << _EOF_ > /etc/systemd/system/noip2.service [Unit] Description=noip2 (DietPi) @@ -8830,8 +8805,7 @@ _EOF_ fi - #dxx-rebirth - software_id=112 + software_id=112 # DDX-Rebirth if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8873,8 +8847,7 @@ _EOF_ fi - #DIETPICAM - software_id=59 + software_id=59 # RPi Cam Control if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -8905,7 +8878,7 @@ WantedBy=multi-user.target _EOF_ # - Replace confs with /var/www to /var/www/rpicam, once - if (( ! $(grep -ci -m1 '/rpicam' /etc/raspimjpeg) )); then + if ! grep -q '/rpicam' /etc/raspimjpeg; then sed -i 's#/var/www#/var/www/rpicam#g' /etc/raspimjpeg sed -i 's#/var/www#/var/www/rpicam#g' /etc/motion/motion.conf @@ -8971,7 +8944,7 @@ WantedBy=multi-user.target _EOF_ # Add web.log to logrotate config - if [[ -f /etc/logrotate.d/deluged ]] && ! grep -q 'web.log' /etc/logrotate.d/deluged; then + if [[ -f '/etc/logrotate.d/deluged' ]] && ! grep -q 'web.log' /etc/logrotate.d/deluged; then echo -e "\n$(> /etc/logrotate.d/deluged sed -i '1,1s/daemon.log/web.log/' /etc/logrotate.d/deluged @@ -8999,9 +8972,9 @@ _EOF_ fi # Remove init.d service leftovers, installed by Debian APT package - [[ -f /etc/init.d/deluged ]] && rm /etc/init.d/deluged - [[ -f /etc/default/deluged ]] && rm /etc/default/deluged - [[ -d /var/lib/deluged ]] && rm -R /var/lib/deluged + [[ -f '/etc/init.d/deluged' ]] && rm /etc/init.d/deluged + [[ -f '/etc/default/deluged' ]] && rm /etc/default/deluged + [[ -d '/var/lib/deluged' ]] && rm -R /var/lib/deluged fi @@ -9027,8 +9000,7 @@ _EOF_ fi - #PIHOLE - software_id=93 + software_id=93 # Pi-hole if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9135,12 +9107,12 @@ _EOF_ fi - software_id=71 # WEBIOPI + software_id=71 # WebIOPi if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - # autostart + # Autostart update-rc.d webiopi defaults fi @@ -9173,23 +9145,22 @@ _EOF_ fi - #HAPROXY - software_id=98 + software_id=98 # HAProxy if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #Create jail directory + # Create jail directory mkdir -p /var/lib/haproxy cat << _EOF_ > /etc/haproxy/haproxy.cfg global - #rsyslog is required for logging + # rsyslog is required for logging #log /var/log local0 #log /var/log local1 notice maxconn 64 - #Jail directory + # Jail directory chroot /var/lib/haproxy stats socket /run/haproxy.sock mode 660 level admin stats timeout 30s @@ -9240,7 +9211,7 @@ backend nodes server web02 127.0.0.1:9001 check server web03 127.0.0.1:9002 check -#Admin web page +# Admin web page listen stats bind *:1338 @@ -9250,7 +9221,7 @@ backend nodes stats auth admin:dietpi _EOF_ - #Add html error pages + # Add html error pages mkdir -p /etc/haproxy/errors local errorcode=0 @@ -9305,7 +9276,7 @@ _EOF_ Banner_Configuration - #Create mysql DB + # Create MariaDB database /DietPi/dietpi/func/create_mysql_db wordpress wordpress "$GLOBAL_PW" fi @@ -9361,8 +9332,7 @@ _EOF_ fi - #TIGHTVNCSERVER / VNC4SERVER / RealVNC - Shared setup - #software_id=27/28/120 + #software_id=27/28/120 # TightVNC/VNC4/RealVNC Server - Shared setup if (( ${aSOFTWARE_INSTALL_STATE[27]} == 1 || ${aSOFTWARE_INSTALL_STATE[28]} == 1 || ${aSOFTWARE_INSTALL_STATE[120]} == 1 )); then @@ -9495,8 +9465,7 @@ _EOF_ fi - #VNC4SERVER / RealVNC - software_id=28 + software_id=28 # VNC4/RealVNC Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} > 0 || ${aSOFTWARE_INSTALL_STATE[120]} > 0 )); then @@ -9549,7 +9518,7 @@ _EOF_ Banner_Configuration - # - Move DB/datadir to userdata location + # Move DB/datadir to userdata location mv /var/lib/influxdb $G_FP_DIETPI_USERDATA/ ln -sf $G_FP_DIETPI_USERDATA/influxdb /var/lib/influxdb @@ -9560,11 +9529,11 @@ _EOF_ Banner_Configuration - # - Move DB/plugins to userdata location, if not already existent + # Move DB/plugins to userdata location, if not already existent if [[ -d $G_FP_DIETPI_USERDATA/grafana ]]; then G_DIETPI-NOTIFY 2 "Existing database/plugin directory $G_FP_DIETPI_USERDATA/grafana found. Will not overwrite..." - [[ -e /var/lib/grafana ]] && rm -R /var/lib/grafana + [[ -e '/var/lib/grafana' ]] && rm -R /var/lib/grafana else @@ -9573,7 +9542,7 @@ _EOF_ fi ln -sf $G_FP_DIETPI_USERDATA/grafana /var/lib/grafana - # - Set password, wrap into trippled double quotes in case of ; or # being contained, according to docs: http://docs.grafana.org/installation/configuration/#password + # Set password, wrap into trippled double quotes in case of ; or # being contained, according to docs: http://docs.grafana.org/installation/configuration/#password GCI_PASSWORD=1 GCI_PRESERVE=1 G_CONFIG_INJECT 'admin_password[[:blank:]]*=' "admin_password = \"\"\"$GLOBAL_PW\"\"\"" /etc/grafana/grafana.ini G_CONFIG_INJECT 'http_port = ' 'http_port = 3001' /etc/grafana/grafana.ini @@ -9605,8 +9574,7 @@ _EOF_ fi - #PHPSYSINFO - software_id=64 + software_id=64 # phpSysInfo if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9616,8 +9584,7 @@ _EOF_ fi - #PHPIMAGEGALLERY - software_id=56 + software_id=56 # PHP Image Gallery if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9639,8 +9606,7 @@ _EOF_ fi - #AMPACHE - software_id=40 + software_id=40 # Ampache if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -9659,15 +9625,14 @@ _EOF_ fi - #OPENVPNSERVER - software_id=97 + software_id=97 # OpenVPN Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration local key_size=2048 - #Start Cert/Key generation. + # Start Cert/Key generation. cp -a /usr/share/easy-rsa/ /etc/openvpn mkdir -p /etc/openvpn/easy-rsa/keys cat << _EOF_ >> /etc/openvpn/easy-rsa/vars @@ -9681,11 +9646,11 @@ export KEY_OU='DietPi' export KEY_NAME='DietPi_OpenVPN_Server' _EOF_ - #Create Server Cert Auth + # Create Server Cert Auth G_DIETPI-NOTIFY 2 'Generating unique OpenVPN certificates and keys. Please wait...\n' openssl dhparam -out /etc/openvpn/dh${key_size}.pem $key_size - #Build Server certs/keys + # Build Server certs/keys chmod -R +x /etc/openvpn/easy-rsa cd /etc/openvpn/easy-rsa # - https://github.com/MichaIng/DietPi/issues/1450#issuecomment-362608574 @@ -9696,16 +9661,16 @@ _EOF_ ./build-ca --batch DietPi_OpenVPN_Server ./build-key-server --batch DietPi_OpenVPN_Server - #Copy Server cert/keys + # Copy Server cert/keys cp -a /etc/openvpn/easy-rsa/keys/{DietPi_OpenVPN_Server.crt,DietPi_OpenVPN_Server.key,ca.crt} /etc/openvpn/ - #Build client cert/keys + # Build client cert/keys ./build-key --batch DietPi_OpenVPN_Client cd /tmp/$G_PROGRAM_NAME - #End Cert/Key generation. + # End Cert/Key generation. - #Server config + # Server config cat << _EOF_ > /etc/openvpn/server.conf port 1194 proto udp @@ -9730,19 +9695,19 @@ persist-key persist-tun verb 3 -#Web Forwarding (uncomment to enable) +# Web Forwarding (uncomment to enable) #push "redirect-gateway" #push "dhcp-option DNS 10.8.0.1" _EOF_ - #Client config + # Client config cat << _EOF_ > /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn client proto udp dev tun -#Ip/Domain name of DietPi system, running OpenVPN server. +# Ip/Domain name of DietPi system, running OpenVPN server. remote mywebsite.com 1194 resolv-retry infinite @@ -9760,7 +9725,7 @@ verb 3 _EOF_ - #Unified client file. Add DietPi generated certs/keys. + # Unified client file. Add DietPi generated certs/keys. # - Add Server Cert auth echo '' >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn cat /etc/openvpn/ca.crt >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn @@ -9774,16 +9739,16 @@ _EOF_ cat /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.key >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn echo '' >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn - #Copy client file to userdata location + # Copy client file to userdata location cp /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn $G_FP_DIETPI_USERDATA/ # - and /boot partition cp /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn /boot/ - #Enable IP forwarding + # 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) + # 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 fi @@ -10099,13 +10064,12 @@ _EOF_ fi - #SHAIRPORTSYNC - software_id=37 + software_id=37 # Shairport-Sync if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #Enable SOXR by default: + # Enable SOXR by default: G_BACKUP_FP /usr/local/etc/shairport-sync.conf cat << _EOF_ > /usr/local/etc/shairport-sync.conf general = @@ -10133,15 +10097,14 @@ alsa = }; _EOF_ - #Create shairport user + # Create shairport user useradd -rM shairport-sync -G audio -s /usr/sbin/nologin chmod +x /usr/local/bin/shairport-sync fi - #PYDIO - software_id=48 + software_id=48 # Pydio if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10214,8 +10177,7 @@ _EOF_ fi - #SQUEEZELITE - software_id=36 + software_id=36 # SqueezeLite if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10229,8 +10191,7 @@ _EOF_ fi - #EMONHUB - software_id=99 + software_id=99 # EmonHub if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10245,7 +10206,7 @@ _EOF_ chmod +x -R /etc/emonhub - #RPI 3 - Must disable BCM BT to recover UART 0 + # RPI 3 - Must disable BCM BT to recover UART 0 if (( $G_HW_MODEL == 3 )); then # - Add DToverlay to disable bluetooth @@ -10275,8 +10236,7 @@ _EOF_ fi - #RPIMONITOR - software_id=66 + software_id=66 # RPi Monitor if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10367,8 +10327,7 @@ _EOF_ fi - #BAIKAL - software_id=57 + software_id=57 # BaiKal if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10423,29 +10382,27 @@ location = /.well-known/caldav { fi - #MUMBLESERVER - software_id=43 + software_id=43 # Mumble Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #Cap total connections + # Cap total connections local max_users=$(( $G_HW_CPU_CORES * 8 )) sed -i "/users=/c\users=$max_users" /etc/mumble-server.ini - #Name the root channel + # Name the root channel sed -i '/registerName=/c\registerName=DietPi Mumble Server' /etc/mumble-server.ini - #Disable DB logging + # Disable DB logging sed -i '/logdays=/c\logdays=-1' /etc/mumble-server.ini - #Set Superuser passwd: https://dietpi.com/phpbb/viewtopic.php?f=11&t=2024#p8084 + # Set Superuser passwd: https://dietpi.com/phpbb/viewtopic.php?f=11&t=2024#p8084 murmurd -ini /etc/mumble-server.ini -supw "$GLOBAL_PW" fi - #EMBYSERVER - software_id=41 + software_id=41 # Emby Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10465,13 +10422,14 @@ location = /.well-known/caldav { fi - #CUBERITE - software_id=52 + software_id=52 # Cuberite if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rM cuberite -G dietpi -s /usr/sbin/nologin + usercmd='useradd -rM' + getent passwd cuberite &> /dev/null && usercmd='usermod' + $usercmd cuberite -G dietpi -d $G_FP_DIETPI_USERDATA/cubrite -s $(command -v nologin) cat << _EOF_ > /etc/systemd/system/cuberite.service [Unit] @@ -10488,7 +10446,7 @@ ExecStart=$G_FP_DIETPI_USERDATA/cubrite/Cuberite --service WantedBy=multi-user.target _EOF_ - #WebUI settings + # WebUI settings cat << _EOF_ > $G_FP_DIETPI_USERDATA/cubrite/webadmin.ini [User:admin] Password=$GLOBAL_PW @@ -10548,23 +10506,24 @@ _EOF_ fi - #GOGS - software_id=49 + software_id=49 # Gogs if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - adduser gogs --system --no-create-home --group --shell=/bin/nologin + # User + usercmd='useradd -rM' + getent passwd gogs &> /dev/null && usercmd='usermod' + $usercmd gogs -d /etc/gogs -s $(command -v nologin) - # - Data storage / user data - mkdir -p $G_FP_DIETPI_USERDATA/gogs-repo - mkdir -p /var/log/gogs - > /var/log/gogs/gogs_daemon.log - chown -R gogs:gogs /var/log/gogs + # Directories + mkdir -p $G_FP_DIETPI_USERDATA/gogs-repo /var/log/gogs + chown -R gogs:gogs $G_FP_DIETPI_USERDATA/gogs-repo /var/log/gogs - # - sqldb + # Database /DietPi/dietpi/func/create_mysql_db gogs gogs "$GLOBAL_PW" + # Service cat << _EOF_ > /etc/systemd/system/gogs.service [Unit] Description=Gogs (DietPi) @@ -10573,11 +10532,8 @@ After=mysqld.service mysql.service mariadb.service [Service] User=gogs -Group=gogs WorkingDirectory=/etc/gogs -Environment=USER=gogs HOME=/etc/gogs ExecStart=/bin/dash -c '/etc/gogs/gogs web 2>&1 > /var/log/gogs/gogs_daemon.log' -StandardOutput=tty [Install] WantedBy=multi-user.target @@ -10585,15 +10541,14 @@ _EOF_ fi - #QBITTORRENT - software_id=46 + software_id=46 # qBitTorrent if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rm qbittorrent -p "$GLOBAL_PW" -G dietpi -s /usr/sbin/nologin + useradd -rm qbittorrent -p "$GLOBAL_PW" -G dietpi -s $(command -v nologin) - # - conf. + # Config mkdir -p /home/qbittorrent/.config/qBittorrent G_BACKUP_FP /home/qbittorrent/.config/qBittorrent/qBittorrent.conf cat << _EOF_ > /home/qbittorrent/.config/qBittorrent/qBittorrent.conf @@ -10674,10 +10629,10 @@ enabled=false 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 + # - 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' /root/.config/qBittorrent/qBittorrent.conf - # - service + # Service cat << _EOF_ > /etc/systemd/system/qbittorrent.service [Unit] Description=qBittorrent (DietPi) @@ -11035,38 +10990,37 @@ _EOF_ fi - #SYNCTHING - software_id=50 + software_id=50 # Syncthing if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - # - Generate dir's + # Generate dirs mkdir -p $G_FP_DIETPI_USERDATA/syncthing mkdir -p $G_FP_DIETPI_USERDATA/syncthing_data - # Logs/Binary + # - Logs/Binary mkdir -p /var/log/syncthing >> /var/log/syncthing/syncthing.log chown -R dietpi:dietpi /var/log/syncthing chown -R dietpi:dietpi /etc/syncthing - # - Run Syncthing to create cert/config and exit + # Run Syncthing to create cert/config and exit /etc/syncthing/syncthing -generate=$G_FP_DIETPI_USERDATA/syncthing - # - Disable automatic upgrades + # Disable automatic upgrades sed -i '/<\/autoUpgradeIntervalH>/c\ 0<\/autoUpgradeIntervalH>' $G_FP_DIETPI_USERDATA/syncthing/config.xml - # - Allow external access (LAN). + # Allow external access (LAN). sed -i '/:8384<\/address>/c\
0.0.0.0:8384<\/address>' $G_FP_DIETPI_USERDATA/syncthing/config.xml - # - Set default folder + # Set default folder sed -i '/label=\"Default Folder/c\ ' $G_FP_DIETPI_USERDATA/syncthing/config.xml - # - Disable browser starting + # Disable browser starting sed -i '/<\/startBrowser>/c\ false<\/startBrowser>' $G_FP_DIETPI_USERDATA/syncthing/config.xml - # - Enable filesystem watcher (previously inotify) + # Enable filesystem watcher (previously inotify) sed -i 's/fsWatcherEnabled=\"false\"/fsWatcherEnabled=\"true\"/g' $G_FP_DIETPI_USERDATA/syncthing/config.xml # Services @@ -11103,8 +11057,7 @@ _EOF_ fi - #Medusa - software_id=116 + software_id=116 # Medusa if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11118,15 +11071,16 @@ _EOF_ fi - #TONIDO - software_id=134 + software_id=134 # Tonido if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rm tonido -G dietpi -s /usr/sbin/nologin + usercmd='useradd -rm' + getent passwd tonido &> /dev/null && usercmd='usermod' + $usercmd tonido -G dietpi -s $(command -v nologin) - #service + # Service cat << _EOF_ > /etc/systemd/system/tonido.service [Unit] Description=Tonido (DietPi) @@ -11135,24 +11089,24 @@ Description=Tonido (DietPi) User=tonido Group=dietpi WorkingDirectory=$G_FP_DIETPI_USERDATA/tonido -ExecStart=/bin/bash -c 'export LD_LIBRARY_PATH=$G_FP_DIETPI_USERDATA/tonido; export TONIDODIR=$G_FP_DIETPI_USERDATA/tonido; ./tonidoconsole' +ExecStart=/bin/dash -c 'export LD_LIBRARY_PATH=$G_FP_DIETPI_USERDATA/tonido; export TONIDODIR=$G_FP_DIETPI_USERDATA/tonido; ./tonidoconsole' [Install] WantedBy=multi-user.target _EOF_ - # - userdirs + # User dirs mkdir -p $G_FP_DIETPI_USERDATA/tonido/sync mkdir -p $G_FP_DIETPI_USERDATA/tonido/syncdata - # symlink + # - Symlink cp -R /home/tonido/tonido $G_FP_DIETPI_USERDATA/ &> /dev/null rm -R /home/tonido/tonido &> /dev/null ln -sf $G_FP_DIETPI_USERDATA/tonido /home/tonido/tonido ln -sf $G_FP_DIETPI_USERDATA/tonido/sync /home/tonido/TonidoSync ln -sf $G_FP_DIETPI_USERDATA/tonido/syncdata /home/tonido/TonidoSyncData - # - armv7 switch + # ARMv7 switch if (( $G_HW_ARCH == 2 )); then sed -i 's/armv6l/armv7l/' $G_FP_DIETPI_USERDATA/tonido/manifest.xml @@ -11167,7 +11121,7 @@ _EOF_ Banner_Configuration - #Allow root, start maximized and disable sandbox under root (blank screen without) + # Allow root, start maximized and disable sandbox under root (blank screen without) local export_options="export CHROMIUM_FLAGS=\"\$CHROMIUM_FLAGS \ --test-type \ --no-sandbox \ @@ -11180,10 +11134,10 @@ _EOF_ --profiler-timing=0 \ --disable-composited-antialiasing " - #RPi + # RPi if (( $G_HW_MODEL < 10 )); then - # OpenGL + # - OpenGL #if (( $G_HW_MODEL >= 2 )); then # Hangs xinit: https://github.com/MichaIng/DietPi/issues/834 @@ -11192,12 +11146,12 @@ _EOF_ #fi : - #OpenGL + # OpenGL elif (( $G_HW_MODEL == 21 )); then : - #GLES + # GLES else export_options+='--use-gl=egl' @@ -11207,28 +11161,25 @@ _EOF_ export_options+="\"" mkdir -p /etc/chromium.d - cat << _EOF_ > /etc/chromium.d/custom_flags -$export_options -_EOF_ + echo "$export_options" > /etc/chromium.d/custom_flags - # Chromium 60+ + # Chromium 60+ cp /etc/chromium.d/custom_flags /root/.chromium-browser.init - #Symlink to desktop - # * for RPi Stretch due to chromium-browser.desktop + # Symlink to desktop + # - * for RPi Stretch due to chromium-browser.desktop 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 - + # 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 +# Autostart run script for Kiosk mode, based on @AYapejian https://github.com/MichaIng/DietPi/issues/1737#issue-318697621 # - 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 -# --pull-to-refresh=1 -# --ash-host-window-bounds="400,300" +# --test-type gets rid of some of the chromium warnings that you may or may not care about in kiosk on a LAN +# --pull-to-refresh=1 +# --ash-host-window-bounds="400,300" # - Resolution to use for kiosk mode, should ideally match current system resolution RES_X=\$(grep -m1 '^[[:blank:]]*SOFTWARE_CHROMIUM_RES_X=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') @@ -11242,7 +11193,7 @@ CHROMIUM_OPTS="--kiosk --test-type --window-size=\$RES_X,\$RES_Y --start-fullscr URL=\$(grep -m1 '^[[:blank:]]*SOFTWARE_CHROMIUM_AUTOSTART_URL=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') CHROMIUM_OPTS+=" --homepage \$URL" -#Find absolute filepath location of Chromium binary. +# Find absolute filepath location of Chromium binary. FP_CHROMIUM=\$(command -v chromium) if [[ ! \$FP_CHROMIUM ]]; then @@ -11257,8 +11208,7 @@ _EOF_ fi - #O!MPD - software_id=129 + software_id=129 # O!MPD if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11280,23 +11230,22 @@ _EOF_ fi - #IceCast + DarkIce - software_id=135 + software_id=135 # IceCast + DarkIce if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #icecast set passwords: + # IceCast set passwords sed -i '/\/c\\'"$GLOBAL_PW"'\<\/source-password\>' /etc/icecast2/icecast.xml sed -i '/\/c\\'"$GLOBAL_PW"'\<\/relay-password\>' /etc/icecast2/icecast.xml - # Create random password + # - Create random password local admin_password=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w10 | head -n1) sed -i "/\/c\\$admin_password\<\/admin-password\>" /etc/icecast2/icecast.xml sed -i '/ENABLE=/c\ENABLE=true' /etc/default/icecast2 - #Darkice + # DarkIce local input_device_index=$(arecord -l | mawk '/card/ {print $2;exit}' | sed 's/://') cat << _EOF_ > /etc/darkice.cfg @@ -11327,7 +11276,7 @@ public = no #localDumpFile = $G_FP_DIETPI_USERDATA/darkice_recording.ogg _EOF_ - #Systemd service for Darkice + # Systemd service for DarkIce rm /etc/init.d/darkice cat << _EOF_ > /etc/systemd/system/darkice.service [Unit] @@ -11344,8 +11293,7 @@ _EOF_ fi - #mosquitto - software_id=123 + software_id=123 # Mosquitto if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11365,7 +11313,7 @@ _EOF_ fi - software_id=131 # Blynk + software_id=131 # Blynk Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11376,11 +11324,16 @@ _EOF_ local config_file_url_address='https://raw.githubusercontent.com/blynkkk/blynk-server/master/server/core/src/main/resources/server.properties' G_RUN_CMD wget "$config_file_url_address" -O $G_FP_DIETPI_USERDATA/blynk/server.properties G_CONFIG_INJECT 'data.folder=' "data.folder=$G_FP_DIETPI_USERDATA/blynk/data" $G_FP_DIETPI_USERDATA/blynk/server.properties + # - Log to RAMlog + mkdir -p /var/log/blynk + G_CONFIG_INJECT 'logs.folder=' 'logs.folder=/var/log/blynk' $G_FP_DIETPI_USERDATA/blynk/server.properties fi # User - useradd -rM blynk -G dietpi -s /usr/sbin/nologin + usercmd='useradd -rM' + getent passwd blynk &> /dev/null && usercmd='usermod' + $usercmd blynk -G dietpi -d $G_FP_DIETPI_USERDATA/blynk -s /usr/sbin/nologin # Service cat << _EOF_ > /etc/systemd/system/blynkserver.service @@ -11391,7 +11344,8 @@ After=network.target [Service] User=blynk Group=dietpi -ExecStart=$(command -v java) -jar $G_FP_DIETPI_USERDATA/blynk/blynkserver.jar -serverConfig $G_FP_DIETPI_USERDATA/blynk/server.properties +WorkingDirectory=$G_FP_DIETPI_USERDATA/blynk +ExecStart=$(command -v java) -jar $G_FP_DIETPI_USERDATA/blynk/blynkserver.jar [Install] WantedBy=multi-user.target @@ -11399,8 +11353,7 @@ _EOF_ fi - #MotionEye - software_id=136 + software_id=136 # MotionEye if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11424,8 +11377,7 @@ _EOF_ fi - #CloudPrint - software_id=137 + software_id=137 # CloudPrint if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11537,15 +11489,14 @@ _EOF_ fi - #spotifyconnectweb - software_id=141 + software_id=141 # Spotify Connect Web if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration cat << _EOF_ > /etc/systemd/system/spotify-connect-web.service [Unit] -Description=spotify-connect-web (DietPi) +Description=Spotify Connect Web (DietPi) After=sound.target [Service] @@ -11558,8 +11509,7 @@ _EOF_ fi - #couchpotato - software_id=142 + software_id=142 # CouchPotato if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11576,8 +11526,7 @@ _EOF_ fi - #Koel - software_id=143 + software_id=143 # Koel if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11622,13 +11571,14 @@ _EOF_ fi - #Sonarr - software_id=144 + software_id=144 # Sonarr if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rM sonarr -G dietpi -s /usr/sbin/nologin + usercmd='useradd -rM' + getent passwd sonarr &> /dev/null && usercmd='usermod' + $usercmd sonarr -G dietpi -d $G_FP_DIETPI_USERDATA/sonarr -s $(command -v nologin) mkdir -p $G_FP_DIETPI_USERDATA/sonarr @@ -11656,13 +11606,14 @@ _EOF_ fi - #Radarr - software_id=145 + software_id=145 # Radarr if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rM radarr -G dietpi -s /usr/sbin/nologin + usercmd='useradd -rM' + getent passwd radarr &> /dev/null && usercmd='usermod' + $usercmd radarr -G dietpi -d $G_FP_DIETPI_USERDATA/radarr -s $(command -v nologin) mkdir -p $G_FP_DIETPI_USERDATA/radarr @@ -11690,13 +11641,14 @@ _EOF_ fi - #Lidarr - software_id=106 + software_id=106 # Lidarr if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rM lidarr -G dietpi -s /usr/sbin/nologin + usercmd='useradd -rM' + getent passwd lidarr &> /dev/null && usercmd='usermod' + $usercmd lidarr -G dietpi -d $G_FP_DIETPI_USERDATA/lidarr -s $(command -v nologin) mkdir -p $G_FP_DIETPI_USERDATA/lidarr @@ -11714,7 +11666,7 @@ ExecStart=/usr/bin/mono -O=-aot /opt/Lidarr/Lidarr.exe -nobrowser -data=$G_FP_DI WantedBy=multi-user.target _EOF_ - # - logs to RAM + # Logs to RAM rm -R $G_FP_DIETPI_USERDATA/lidarr/logs* &> /dev/null mkdir -p /var/log/lidarr ln -sf /var/log/lidarr $G_FP_DIETPI_USERDATA/lidarr/logs @@ -11724,16 +11676,21 @@ _EOF_ fi - #PlexPy - software_id=146 + software_id=146 # PlexPy if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - mkdir -p $G_FP_DIETPI_USERDATA/plexpy + # User + usercmd='useradd -rM' + getent passwd plexpy &> /dev/null && usercmd='usermod' + $usercmd plexpy -G dietpi -d /opt/plexpy -s $(command -v nologin) - useradd -rM plexpy -G dietpi -s /usr/sbin/nologin + # Directory + mkdir -p $G_FP_DIETPI_USERDATA/plexpy + chown plexpy:dietpi /opt/plexpy $G_FP_DIETPI_USERDATA/plexpy + # Service cat << _EOF_ > /etc/systemd/system/plexpy.service [Unit] Description=Tautulli - Stats for Plex Media Server usage (DietPi) @@ -11751,14 +11708,20 @@ _EOF_ fi - #Jackett - software_id=147 + software_id=147 # Jackett if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - adduser jackett --system --no-create-home --group --shell=/usr/sbin/nologin + # User + usercmd='useradd -rM' + getent passwd jackett &> /dev/null && usercmd='usermod' + $usercmd jackett -d /opt/jackett -s $(command -v nologin) + + # Permissions + chown -R jackett:jackett /opt/jackett + # Service: https://github.com/Jackett/Jackett/wiki/systemd-service cat << _EOF_ > /etc/systemd/system/jackett.service [Unit] Description=Jackett Daemon (DietPi) @@ -11766,22 +11729,37 @@ After=network.target [Service] User=jackett -Group=jackett -WorkingDirectory=/opt/jackett -Environment=USER=jackett HOME=/opt/jackett +Environment=XDG_CONFIG_HOME=/opt/jackett +ExecStart=$(command -v mono) -O=-aot /opt/jackett/JackettConsole.exe --NoRestart Restart=always RestartSec=5 -ExecStart=/usr/bin/mono -O=-aot /opt/jackett/JackettConsole.exe TimeoutStopSec=20 +# These lines optionally isolate (sandbox) Jackett from the rest of the system. +ProtectSystem=strict +ProtectHome=true +PrivateDevices=true +PrivateTmp=true +ReadWritePaths=/opt/jackett + [Install] WantedBy=multi-user.target _EOF_ + # - Non-ARMv6 devices run the standalone version: https://github.com/Jackett/Jackett#install-on-linux-amdx64 + (( $G_HW_ARCH != 1 )) && G_CONFIG_INJECT 'ExecStart=' 'ExecStart=/opt/jackett/jackett --NoRestart' /etc/systemd/system/jackett.service + + # - Jessie: ProtectSystem=strict and ReadWritePaths not supported, use ProtectSystem=full instead: https://manpages.debian.org/jessie/systemd/systemd.exec.5.en.html + if (( $G_DISTRO < 4 )); then + + G_CONFIG_INJECT 'ProtectSystem=' 'ProtectSystem=full' /etc/systemd/system/jackett.service + sed -i '/^ReadWritePaths=/d' /etc/systemd/system/jackett.service + + fi + fi - #NZBget - software_id=149 + software_id=149 # NZBget if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11850,8 +11828,7 @@ _EOF_ fi - #OctoPrint - software_id=153 + software_id=153 # OctoPrint if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11869,8 +11846,7 @@ _EOF_ fi - #RoonServer - software_id=154 + software_id=154 # Roon Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11890,8 +11866,7 @@ _EOF_ fi - #Steam - software_id=156 + software_id=156 # Steam if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11904,8 +11879,7 @@ _EOF_ fi - #------------------ Home Automation: Home Assistant ------------------ - software_id=157 + software_id=157 # Home Assistant if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11931,10 +11905,8 @@ _EOF_ ln -sf $G_FP_DIETPI_USERDATA/homeassistant /home/homeassistant/.homeassistant fi - #------------------------------------------------------------------- - #Minio Config - software_id=158 + software_id=158 # Minio if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11956,8 +11928,7 @@ _EOF_ fi - #Docker Config - software_id=162 + software_id=162 # Docker if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -11981,9 +11952,7 @@ _EOF_ fi - #------------------------------------------------------------------- - #FuguHub Config - software_id=161 + software_id=161 # FuguHub if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -12009,9 +11978,7 @@ _EOF_ fi - #------------------------------------------------------------------- - #Nukkit Config - software_id=164 + software_id=164 # Nukkit if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -12063,8 +12030,7 @@ _EOF_ fi - #Allo Config - software_id=159 # 160 for quick reinstall/update + software_id=159 # Allo: 160 for quick reinstall/update if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 || ${aSOFTWARE_INSTALL_STATE[160]} == 1 )); then @@ -12242,16 +12208,15 @@ _EOF_ fi - #Google AIY - software_id=169 + software_id=169 # Google AIY if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - # - Symlink userdata location for assistant.json + # Symlink userdata location for assistant.json ln -sf $G_FP_DIETPI_USERDATA/voice-recognizer-raspi/assistant.json /home/dietpi/assistant.json - # - Generate cache dir + # Generate cache dir mkdir -p /home/dietpi/.cache/voice-recognizer # Setup soundcard @@ -12259,13 +12224,12 @@ _EOF_ fi - #PiJuice - software_id=100 + software_id=100 # PiJuice if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #RPi enable i2c required for GUI + # RPi enable i2c required for GUI (( $G_HW_MODEL < 10 )) && /DietPi/dietpi/func/dietpi-set_hardware i2c enable mkdir -p /var/lib/dietpi/dietpi-software/installed/pijuice @@ -12838,15 +12802,19 @@ _EOF_ fi - software_id=131 + software_id=131 # Blynk Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - [[ -f /etc/systemd/system/blynkserver.service ]] && rm /etc/systemd/system/blynkserver.service - [[ -d $G_FP_DIETPI_USERDATA/blynk ]] && rm -R $G_FP_DIETPI_USERDATA/blynk - [[ -d /etc/blynkserver ]] && rm -R /etc/blynkserver #pre v6.19 + if [[ -f '/etc/systemd/system/blynkserver.service' ]]; then + + systemctl disable blynkserver + rm /etc/systemd/system/blynkserver.service + fi userdel -rf blynk + [[ -d $G_FP_DIETPI_USERDATA/blynk ]] && rm -R $G_FP_DIETPI_USERDATA/blynk + [[ -d '/etc/blynkserver' ]] && rm -R /etc/blynkserver # Pre-v6.19 fi @@ -13065,13 +13033,18 @@ _EOF_ fi - software_id=147 + software_id=147 # Jackett if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - userdel -rf jackett - rm -R /opt/jackett - rm /etc/systemd/system/jackett.service + getent passwd jackett &> /dev/null && userdel -rf jackett + [[ -d '/opt/jackett' ]] && rm -R /opt/jackett + if [[ -f '/etc/systemd/system/jackett.service' ]]; then + + systemctl disable jackett + rm /etc/systemd/system/jackett.service + + fi fi diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 9fe8836d74..418e0a96d0 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -55,7 +55,7 @@ # DietPi Versions/Branch G_DIETPI_VERSION_CORE=${G_DIETPI_VERSION_CORE:-6} G_DIETPI_VERSION_SUB=${G_DIETPI_VERSION_SUB:-23} - G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-1} + G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-2} G_GITBRANCH=${G_GITBRANCH:-master} G_GITOWNER=${G_GITOWNER:-MichaIng} [[ -f '/DietPi/dietpi/.version' && $( /etc/apt/sources.list echo "deb https://archive.raspberrypi.org/debian/ $G_DISTRO_NAME main ui" > /etc/apt/sources.list.d/raspi.list - # Update dietpi.txt entry + # - Update dietpi.txt entry G_CONFIG_INJECT 'CONFIG_APT_RASPBIAN_MIRROR=' "CONFIG_APT_RASPBIAN_MIRROR=$INPUT_MODE_VALUE" /DietPi/dietpi.txt - # - Set Debian + # Set Debian else cat << _EOF_ > /etc/apt/sources.list @@ -145,7 +143,7 @@ deb https://deb.debian.org/debian-security/ $G_DISTRO_NAME/updates main contrib deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free _EOF_ - # Jessie: https://github.com/MichaIng/DietPi/issues/2665#issuecomment-477348864 + # - Jessie: https://github.com/MichaIng/DietPi/issues/2665#issuecomment-477348864 if (( $G_DISTRO < 4 )); then # - Jessie APT reports warning on httpS://deb.debian.org @@ -155,14 +153,14 @@ _EOF_ # - ARMv8 has been dropped from security repo (( $G_HW_ARCH == 3 )) && sed -i '/debian-security/d' /etc/apt/sources.list - # Buster, remove backports: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-351830101 + # - Buster, remove backports: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-351830101 elif (( $G_DISTRO > 4 )); then sed -i '/backports/d' /etc/apt/sources.list fi - # Update dietpi.txt entry + # - Update dietpi.txt entry G_CONFIG_INJECT 'CONFIG_APT_DEBIAN_MIRROR=' "CONFIG_APT_DEBIAN_MIRROR=$INPUT_MODE_VALUE" /DietPi/dietpi.txt fi @@ -193,12 +191,12 @@ _EOF_ local ntp_mirror_entry='Servers='$ntp_mirror # - Default, lets timesyncd use DHCP server (Stretch+ only) or fallback to debian.pool.ntp.org. - if [[ ${ntp_mirror,,} == default ]]; then + if [[ ${ntp_mirror,,} == 'default' ]]; then ntp_mirror_entry='#Servers=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org' # - Gateway, auto detect local gateway(s) (router) to use as NTP server. - elif [[ ${ntp_mirror,,} == gateway ]]; then + elif [[ ${ntp_mirror,,} == 'gateway' ]]; then # NB: Turn output output into single line string via echo local gateway=$(echo $(ip r | mawk '/^default/ {print $3}')) @@ -270,7 +268,7 @@ _EOF_ } #///////////////////////////////////////////////////////////////////////////////////// - # allo + # Allo #///////////////////////////////////////////////////////////////////////////////////// Allo_Main(){ @@ -458,7 +456,7 @@ _EOF_ chown -R sabnzbd:dietpi $G_FP_DIETPI_USERDATA/downloads/{,in}complete # - Blynk - chown -R blynk:dietpi $G_FP_DIETPI_USERDATA/blynk + chown -R blynk:dietpi $G_FP_DIETPI_USERDATA/blynk /var/log/blynk # - Pi-hole # - NB: Git requies special permissions to allow "pihole -up". @@ -481,22 +479,20 @@ _EOF_ mkdir -p /home useradd -m -s /bin/bash "$INPUT_MODE_VALUE" -p "$(grep -m1 '^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')" - # Copy existing profile/bashrc + # Copy existing profile/bashrc cp /root/.profile /home/"$INPUT_MODE_VALUE"/ cp /root/.bashrc /home/"$INPUT_MODE_VALUE"/ chown -R "$INPUT_MODE_VALUE":"$INPUT_MODE_VALUE" /home/"$INPUT_MODE_VALUE" - # Allow sudo without pw + # Allow sudo without pw if ! grep -q "^$INPUT_MODE_VALUE[[:space:]]" /etc/sudoers.d/dietpi; then - cat << _EOF_ >> /etc/sudoers.d/dietpi -$INPUT_MODE_VALUE ALL=NOPASSWD: ALL -_EOF_ + echo "$INPUT_MODE_VALUE ALL=NOPASSWD: ALL" >> /etc/sudoers.d/dietpi fi - # Same groups as user pi + # Same groups as user pi local group_array=() group_array+=('input') group_array+=('netdev') @@ -514,13 +510,13 @@ _EOF_ group_array+=('dialout') group_array+=('adm') - # + allow access to www-data + # Allow access to www-data group_array+=('www-data') - for ((i=0; i<${#group_array[@]}; i++)) + for i in ${group_array[@]} do - usermod -a -G "${group_array[$i]}" "$INPUT_MODE_VALUE" + usermod -a -G $i "$INPUT_MODE_VALUE" done @@ -538,12 +534,11 @@ _EOF_ if [[ $INPUT_MODE_VALUE ]]; then - # - Delete $INPUT_MODE_VALUE - userdel -f "$INPUT_MODE_VALUE" - rm -R "/home/$INPUT_MODE_VALUE" + # Delete $INPUT_MODE_VALUE + userdel -rf "$INPUT_MODE_VALUE" - # - Remove from sudoers - sed -i "/^$INPUT_MODE_VALUE[[:space:]]/d" /etc/sudoers.d/dietpi + # Remove from sudoers + sed -i "/^$INPUT_MODE_VALUE[[:blank:]]/d" /etc/sudoers.d/dietpi else @@ -560,8 +555,7 @@ _EOF_ [[ $gitbranch ]] || gitbranch='master' INSTALL_URL="https://raw.githubusercontent.com/MichaIng/DietPi/$gitbranch/dietpi.txt" - G_CHECK_URL "$INSTALL_URL" - if (( ! $? )); then + if G_CHECK_URL "$INSTALL_URL"; then G_DIETPI-NOTIFY 0 'Patching dietpi.txt' l_message='Downloading current dietpi.txt' G_RUN_CMD wget "$INSTALL_URL" -O /tmp/dietpi.txt_patch @@ -610,16 +604,16 @@ _EOF_ local pw_dietpi_software='' local pw_root_dietpi_users='' - #Automation/input mode, set and then apply input password to both dietpi-software and root/dietpi user passwords. + # Automation/input mode, set and then apply input password to both dietpi-software and root/dietpi user passwords. if [[ $INPUT_MODE_VALUE ]]; then pw_dietpi_software=$INPUT_MODE_VALUE pw_root_dietpi_users=$INPUT_MODE_VALUE - #Prompt to change + # Prompt to change else - #DietPi-Software PW + # DietPi-Software PW G_WHIP_YESNO 'Do you want to adjust the default global password for DietPi-Software installations and new unix users? We especially recommend to change the default password "dietpi". This does not affect any existing unix user login.\n NB: This password will be saved and encrypted within /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin to be useable by DietPi scripts for e.g. web application and database logins. We highly recommend to adjust all passwords for web services and new unix users independently afterwards.' if (( ! $? )); then @@ -630,7 +624,7 @@ NB: This password will be saved and encrypted within /var/lib/dietpi/dietpi-soft fi - #Root/DietPi user PW + # Root/DietPi user PW G_WHIP_YESNO 'Change unix user passwords?\n\nDietPi has two accounts by default "root" and "dietpi". On first boot, both share the global password "dietpi", respectively the one set in dietpi.txt.\n It is highly recommended to change this password, ideally, it should be different than the global DietPi-Software password.\n\nWould you like to change the login passwords for "root" and "dietpi"?' if (( ! $? )); then @@ -643,7 +637,7 @@ It is highly recommended to change this password, ideally, it should be differen fi - #Apply | dietpi-software PW + # Apply | dietpi-software PW if [[ $pw_dietpi_software ]]; then # - Nullify automated PW @@ -662,7 +656,7 @@ It is highly recommended to change this password, ideally, it should be differen fi - #Apply | Root/DietPi users PW + # Apply | Root/DietPi users PW if [[ $pw_root_dietpi_users ]]; then chpasswd <<< "root:$pw_root_dietpi_users" @@ -677,8 +671,7 @@ It is highly recommended to change this password, ideally, it should be differen # Main Loop #///////////////////////////////////////////////////////////////////////////////////// #----------------------------------------------------------------------------------- - #info - + # Info G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$INPUT_MODE_NAME ($INPUT_MODE_VALUE)" #----------------------------------------------------------------------------------- diff --git a/dietpi/patch_file b/dietpi/patch_file index 9489fa8178..356273298c 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -271,9 +271,9 @@ _EOF_ if (( $G_DIETPI_INSTALL_STAGE == 2 )); then # - RPi cam pre-patch - [[ -d /var/www/dietpicam ]] && mv /var/www/dietpicam /var/www/rpicam + [[ -d '/var/www/dietpicam' ]] && mv /var/www/dietpicam /var/www/rpicam [[ -d $G_FP_DIETPI_USERDATA/dietpicam ]] && mv $G_FP_DIETPI_USERDATA/dietpicam $G_FP_DIETPI_USERDATA/rpicam - [[ -e /var/www/rpicam/media ]] && rm /var/www/rpicam/media + [[ -e '/var/www/rpicam/media' ]] && rm /var/www/rpicam/media /DietPi/dietpi/dietpi-software reinstall 59 132 @@ -430,7 +430,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Remove minutely running "make_nas_processes_faster" cron job, present on images with preinstalled OMV: https://github.com/MichaIng/DietPi/issues/1654 - [[ -f /etc/cron.d/make_nas_processes_faster ]] && rm /etc/cron.d/make_nas_processes_faster + [[ -f '/etc/cron.d/make_nas_processes_faster' ]] && rm /etc/cron.d/make_nas_processes_faster #------------------------------------------------------------------------------- #Add Dropbear ecdsa and dss host keys, if missing: https://github.com/MichaIng/DietPi/issues/1670 if (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[104\]=2' /DietPi/dietpi/.installed; then @@ -492,12 +492,12 @@ _EOF_ if { (( $G_HW_MODEL < 10 )) && ! grep -q 'allo-piano-dac' /DietPi/config.txt; } || { (( $G_HW_MODEL == 70 )) && ! grep -q 'allo-piano-dac' /etc/modules; }; then - [[ -d /lib/firmware/allo ]] && rm -R /lib/firmware/allo + [[ -d '/lib/firmware/allo' ]] && rm -R /lib/firmware/allo fi #------------------------------------------------------------------------------- #RPi UART: https://github.com/MichaIng/DietPi/issues/1759 - if [[ -f /DietPi/config.txt ]]; then + if [[ -f '/DietPi/config.txt' ]]; then local serial_state=$(grep -m1 '^[[:blank:]]*CONFIG_SERIAL_CONSOLE_ENABLE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') G_CONFIG_INJECT 'enable_uart=' "enable_uart=$serial_state" /DietPi/config.txt @@ -1010,7 +1010,7 @@ _EOF_ #------------------------------------------------------------------------------- #Update IPv6 handling: https://github.com/MichaIng/DietPi/issues/2027 # - Advice user to re-enable IPv6 on kernel level - if [[ ! -d /proc/sys/net/ipv6 ]]; then + if [[ ! -d '/proc/sys/net/ipv6' ]]; then G_WHIP_MENU_ARRAY=( @@ -1188,11 +1188,11 @@ _EOF_ # OMPD: https://github.com/MichaIng/DietPi/issues/2156#issue-372201367 # MyMPD: https://github.com/MichaIng/DietPi/issues/2156#issue-372201367 # RoonBridge: https://community.roonlabs.com/t/dietpi-allo-units-not-getting-the-roonbridge-b167-update-from-b164/52503/10?u=dan_knight - # Radarr/lidarr/sonarr/jacket: https://github.com/MichaIng/DietPi/issues/2219 + # Radarr/Lidarr/Sonarr: https://github.com/MichaIng/DietPi/issues/2219 # Mosquitto: https://github.com/MichaIng/DietPi/issues/2243#issuecomment-439492463 if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - /DietPi/dietpi/dietpi-software reinstall 106 121 123 129 144 145 147 148 + /DietPi/dietpi/dietpi-software reinstall 106 121 123 129 144 145 148 # - Switch to "mariadb" systemd service on Stretch+: https://github.com/MichaIng/DietPi/pull/2196 if (( $G_DISTRO > 3 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[88\]=2' /DietPi/dietpi/.installed; then @@ -1357,7 +1357,7 @@ _EOF_ # - Samba: Link disk cache to RAM: https://github.com/MichaIng/DietPi/issues/2396 if grep -q '^aSOFTWARE_INSTALL_STATE\[96\]=2' /DietPi/dietpi/.installed; then - [[ -e /var/cache/samba ]] && rm -R /var/cache/samba + [[ -e '/var/cache/samba' ]] && rm -R /var/cache/samba mkdir -p /var/run/samba-cache ln -s /var/run/samba-cache /var/cache/samba echo 'd /var/run/samba-cache - - - - -' > /etc/tmpfiles.d/dietpi-samba_cache.conf @@ -1429,7 +1429,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix #Clear install state for Medusa (( $G_DIETPI_INSTALL_STAGE == 2 )) && [[ ! -d $G_FP_DIETPI_USERDATA/medusa ]] && G_CONFIG_INJECT 'aSOFTWARE_INSTALL_STATE\[116\]=' 'aSOFTWARE_INSTALL_STATE[116]=0' /DietPi/dietpi/.installed # - Inform user about SickRage being replaced by Medusa - if [[ -d /etc/sickrage || -d $G_FP_DIETPI_USERDATA/sickrage ]]; then + if [[ -d '/etc/sickrage' || -d $G_FP_DIETPI_USERDATA/sickrage ]]; then G_WHIP_MSG '[WARNING] We found an existing SickRage install on your system\n We already dropped SickRage from DietPi-Software install options with v6.18, now it has been fully replaced with "Medusa", an older stabilized fork. @@ -1755,8 +1755,8 @@ NB: When accessing "deluge-console" you need to do that as user "debian-deluged" With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files.\n This script has gone through some rework and polishing with v6.23 and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown.\n Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' - - #Jessie C1 switch to Stretch | should not occur for pre-patch compatible versions and auto switch over to jessie-support for existing installs. + #----------------------------------------------------------------------- + # Jessie C1 switch to Stretch | should not occur for pre-patch compatible versions and auto switch over to jessie-support for existing installs. elif (( $G_HW_MODEL == 10 )); then G_WHIP_MSG '[INFO] Odroid C1 image has been updated to Stretch. Please upgrade to continue limited support for this device:\nhttps://github.com/MichaIng/DietPi/issues/2561#issuecomment-488685121' @@ -1800,6 +1800,16 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828' # Add /etc/network/interfaces.d/ drop-in config support grep -q 'interfaces\.d' /etc/network/interfaces || sed -i '1i\source interfaces.d/*' /etc/network/interfaces #----------------------------------------------------------------------- + # Blynk: Fix logging and move to RAMlog: https://github.com/MichaIng/DietPi/pull/2779 + if [[ -f '/etc/systemd/system/blynkserver.service' && -f $G_FP_DIETPI_USERDATA/blynk/server.properties ]]; then + + G_CONFIG_INJECT 'WorkingDirectory=' "WorkingDirectory=$G_FP_DIETPI_USERDATA/blynk" /etc/systemd/system/blynkserver.service '\[Service\]' + mkdir -p /var/log/blynk + chown -R blynk:dietpi /var/log/blynk + G_CONFIG_INJECT 'logs.folder=' 'logs.folder=/var/log/blynk' $G_FP_DIETPI_USERDATA/blynk/server.properties + + fi + #----------------------------------------------------------------------- # PHP7.3 migration: https://github.com/MichaIng/DietPi/issues/2367 local reinstall_ids='' local upgrade_php=0 @@ -1904,14 +1914,21 @@ Your Nextcloud data are not touched.' dpkg-query -s plexmediaserver-installer &> /dev/null && dpkg -r plexmediaserver-installer [[ -f '/etc/apt/sources.list.d/plex.list' ]] && rm /etc/apt/sources.list.d/plex.list # Logitech Media Server: https://github.com/MichaIng/DietPi/commit/eccef6700381c3f044ec4d435beb167736db0bb4 - # SABnzbd: https://github.com/MichaIng/DietPi/pull/2768 if [[ -f '/etc/systemd/system/squeezeboxserver.service' ]]; then systemctl disable squeezeboxserver mv /etc/systemd/system/squeezeboxserver.service /etc/systemd/system/logitechmediaserver.service fi - /DietPi/dietpi/dietpi-software reinstall 34 35 42 139 $reinstall_ids + # SABnzbd: https://github.com/MichaIng/DietPi/pull/2768 + # Jackett: https://github.com/MichaIng/DietPi/pull/2773 + if [[ -d '/opt/jackett/.config' ]]; then + + cp -a /opt/jackett/.config/. /opt/jackett/ + rm -R /opt/jackett/.config + + fi + /DietPi/dietpi/dietpi-software reinstall 34 35 42 139 147 $reinstall_ids #----------------------------------------------------------------------- # Remove old PHP version if (( $upgrade_php )); then diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index 2a01bb1a3e..382867f696 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 23 -1 +2