From 630d62b57dc5a529066594b17a64952878842cc9 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 24 Nov 2018 18:12:43 +0100 Subject: [PATCH 01/10] v6.18 + DietPi-Software | Single missing white space and many minor code improvements --- dietpi/dietpi-software | 201 ++++++++++++++++------------------------- 1 file changed, 79 insertions(+), 122 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f0c25f6810..cc53995498 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -142,7 +142,7 @@ _EOF_ [[ $1 == 'temp' ]] && fp_target=$FP_INSTALLED_FILE_TEMP #Load - [[ -f $fp_target ]]&& . $fp_target + [[ -f $fp_target ]] && . $fp_target #Always reset choice system during first run to defaults: https://github.com/Fourdee/DietPi/issues/1122 if (( $G_DIETPI_INSTALL_STAGE == 0 )); then @@ -165,7 +165,7 @@ _EOF_ } - Reset_NTPD(){ + Reset_Timesync(){ killall -w /DietPi/dietpi/func/run_ntpd &> /dev/null @@ -173,67 +173,59 @@ _EOF_ Check_Internet_and_NTPD(){ - #Internet + # Internet # - Use /etc/apt/sources.list for connection test local internet_url_test="$(grep -m1 '^[[:blank:]]*deb ' /etc/apt/sources.list | awk '{print $2}')" - optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$internet_url_test" #will exit on failure here then prompt user to configure network + optional_cmd_inputs='--no-check-certificate' G_CHECK_URL "$internet_url_test" # Will exit on failure here then prompt user to configure network - #NTPD - while : + # Timesync + until /DietPi/dietpi/func/run_ntpd do - if ! /DietPi/dietpi/func/run_ntpd; then - - # Endless retry - if (( ! $G_USER_INPUTS )); then - - Reset_NTPD - - # Ask - else - - G_WHIP_MENU_ARRAY=( + # - Ask + if (( $G_USER_INPUTS )); then - 'Retry' ': (Recommended) Runs the NTPD update again' - 'NTP mirror' ': Allows you to change the NTP mirror used' - 'NTP mode' ': Change NTP mode (eg: daemon + drift)' - 'Override' ': (NOT RECOMMENDED) override NTP and system clock update' + G_WHIP_MENU_ARRAY=( - ) + 'Retry' ': (Recommended) Rerun network time sync' + 'NTP mirror' ': Change the NTP mirror used' + 'NTP mode' ': Change the NTP mode (eg: daemon + drift)' + 'Override' ': (NOT RECOMMENDED) Ignore failure and override time sync status' - G_WHIP_MENU "NTPD timesync has not yet completed, or, failed to update.\nTo prevent issues with outdated system time during installations, please select an option below.\n -NB: We highly recommend choosing 'Retry' first. Failing that, 'mirror' then 'mode'.\n'Override' is a last resort and may cause future issues due to incorrect system clock time." - if (( ! $? )); then + ) - if [[ $G_WHIP_RETURNED_VALUE == 'Retry' ]]; then + G_WHIP_MENU 'Network time sync has not yet completed, or, failed to update.\nTo prevent issues with outdated system time during installations, please select an option below.\n +NB: We highly recommend choosing "Retry" first. Failing that, "NTP mirror" then "NTP mode".\n"Override" is a last resort and may cause follow-up issues due to incorrect system clock time.' + if (( ! $? )); then - Reset_NTPD + if [[ $G_WHIP_RETURNED_VALUE == 'Retry' ]]; then - elif [[ $G_WHIP_RETURNED_VALUE == 'Mirror' ]]; then + Reset_Timesync - G_WHIP_MSG 'DietPi-Config will now be launched, on the next screen:\n - Select "NTP Mirror"\n - Select a different NTP mirror\n\nOnce completed, exit dietpi-config to resume setup' - /DietPi/dietpi/dietpi-config 16 1 + elif [[ $G_WHIP_RETURNED_VALUE == 'NTP mirror' ]]; then - elif [[ $G_WHIP_RETURNED_VALUE == 'NTPD Mode' ]]; then + G_WHIP_MSG 'DietPi-Config will now be launched, on the next screen:\n - Select "NTP Mirror"\n - Select a different NTP mirror\n\nOnce completed, exit dietpi-config to resume setup' + /DietPi/dietpi/dietpi-config 16 1 - G_WHIP_MSG 'DietPi-Config will now be launched, on the next screen:\n - Select "Time sync mode"\n - Select a different time sync mode (eg: Daemon + Drift)\n\nOnce completed, exit dietpi-config to resume setup' - /DietPi/dietpi/dietpi-config 3 1 + elif [[ $G_WHIP_RETURNED_VALUE == 'NTP mode' ]]; then - elif [[ $G_WHIP_RETURNED_VALUE == 'Override' ]]; then + G_WHIP_MSG 'DietPi-Config will now be launched, on the next screen:\n - Select "Time sync mode"\n - Select a different time sync mode (eg: Daemon + Drift)\n\nOnce completed, exit dietpi-config to resume setup' + /DietPi/dietpi/dietpi-config 3 1 - Reset_NTPD - echo 0 > /DietPi/dietpi/.timesync_exit_status - echo 1 > /var/lib/dietpi/.ntpd_override + elif [[ $G_WHIP_RETURNED_VALUE == 'Override' ]]; then - fi + Reset_Timesync + echo 0 > /DietPi/dietpi/.timesync_exit_status + echo 1 > /var/lib/dietpi/.ntpd_override fi fi + # - Endless retry else - break + Reset_Timesync fi @@ -4867,35 +4859,26 @@ _EOF_ useradd pivpn mkdir -p /home/pivpn - while : - do - - wget "$INSTALL_URL_ADDRESS" -O pivpn_install.sh - chmod +x pivpn_install.sh + wget "$INSTALL_URL_ADDRESS" -O pivpn_install.sh + chmod +x pivpn_install.sh - # - Disable reboot - sed -i '/shutdown[[:space:]]/d' pivpn_install.sh + # - Disable reboot + sed -i '/shutdown[[:space:]]/d' pivpn_install.sh - ./pivpn_install.sh - if (( $? != 0 )); then - - G_WHIP_YESNO "The PiVPN installer was not successful and/or canceled prior to its completion.\n\nWould you like DietPi to run the PiVPN installer again?" - if (( $? != 0 )); then - - aSOFTWARE_INSTALL_STATE[$software_id]=0 - break + until ./pivpn_install.sh + do - fi + if ! G_WHIP_YESNO "The PiVPN installer was not successful and/or cancelled prior to its completion.\n\nWould you like DietPi to run the PiVPN installer again?"; then - else - - rm pivpn_install.sh + aSOFTWARE_INSTALL_STATE[$software_id]=0 break fi done + rm pivpn_install.sh + fi #LETSENCRYPT @@ -4922,6 +4905,9 @@ _EOF_ else + # - Remove/Update existing certbot installer 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 @@ -4951,8 +4937,7 @@ _EOF_ Download_Install 'https://dietpi.com/downloads/binaries/all/hostapd_2.5_all.zip' # - Check for RTL8188C* device, use the patched binary I compiled: https://github.com/pritambaral/hostapd-rtl871xdrv#why - if (( $(lsusb | grep -ci -m1 'RTL8188C') || - $G_HW_MODEL == 70 )); then #Force RTL for allo provided WiFi dongle + if lsusb | grep -qi 'RTL8188C' || (( $G_HW_MODEL == 70 )); then #Force RTL for allo provided WiFi dongle WIFIHOTSPOT_RTL8188C_DEVICE=1 @@ -4966,38 +4951,23 @@ _EOF_ if (( $G_HW_ARCH == 1 )); then filename_hostapd='hostapd-nl80211-armv6' + (( $WIFIHOTSPOT_RTL8188C_DEVICE )) && filename_hostapd='hostapd-rtl8188c-armv6' filename_hostapd_cli='hostapd_cli-armv6' - if (( $WIFIHOTSPOT_RTL8188C_DEVICE )); then - - filename_hostapd='hostapd-rtl8188c-armv6' - - fi - # - armv7+ elif (( $G_HW_ARCH == 2 )); then filename_hostapd='hostapd-nl80211-armv7' + (( $WIFIHOTSPOT_RTL8188C_DEVICE )) && filename_hostapd='hostapd-rtl8188c-armv7' filename_hostapd_cli='hostapd_cli-armv7' - if (( $WIFIHOTSPOT_RTL8188C_DEVICE )); then - - filename_hostapd='hostapd-rtl8188c-armv7' - - fi - # - arm64 elif (( $G_HW_ARCH == 3 )); then filename_hostapd='hostapd-nl80211-arm64' + (( $WIFIHOTSPOT_RTL8188C_DEVICE )) && filename_hostapd='hostapd-rtl8188c-arm64' filename_hostapd_cli='hostapd_cli-arm64' - if (( $WIFIHOTSPOT_RTL8188C_DEVICE )); then - - filename_hostapd='hostapd-rtl8188c-arm64' - - fi - fi mv "$filename_hostapd" /usr/sbin/hostapd @@ -6024,7 +5994,7 @@ If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use it's inte Banner_Installing - debconf-set-selections <<< "steam steam/question select I AGREE" + debconf-set-selections <<< 'steam steam/question select I AGREE' G_AGI steam @@ -6233,7 +6203,7 @@ If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use it's inte G_CHECK_URL "$INSTALL_URL_ADDRESS" wget -O - "$INSTALL_URL_ADDRESS" | apt-key add - - echo -e "deb https://dtcooper.github.io/raspotify jessie main" > /etc/apt/sources.list.d/raspotify.list + echo 'deb https://dtcooper.github.io/raspotify jessie main' > /etc/apt/sources.list.d/raspotify.list G_AGUP G_AGI raspotify @@ -6265,7 +6235,7 @@ If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use it's inte # - Services sed -i "s#/home/pi#$G_FP_DIETPI_USERDATA#g" systemd/voice-recognizer.service - sed -i "/^User=/c\User=dietpi" systemd/voice-recognizer.service + sed -i '/^User=/c\User=dietpi' systemd/voice-recognizer.service cp systemd/voice-recognizer.service /etc/systemd/system/ cp systemd/alsa-init.service /etc/systemd/system/ @@ -6722,7 +6692,7 @@ _EOF_ # - Remove all references before adding the entry: https://github.com/Fourdee/DietPi/issues/604 sed -i '/PermitRootLogin[[:space:]]/d' /etc/ssh/sshd_config - echo -e "\n\n#Allow root login over SSH\nPermitRootLogin yes" >> /etc/ssh/sshd_config + echo -e '\n\n#Allow root login over SSH\nPermitRootLogin yes' >> /etc/ssh/sshd_config #Generate host keys # - remove all previous @@ -7161,10 +7131,10 @@ _EOF_ # Create_Desktop_Shared_Items # # #Odroid C2, define default pulseaudio sink: https://github.com/Fourdee/DietPi/issues/415 - # if (( $G_HW_MODEL == 12 && - # ! $(cat /etc/pulse/default.pa | grep -ci -m1 '^set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo') )); then + # if (( $G_HW_MODEL == 12 )) && + # ! grep -qi '^set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo' /etc/pulse/default.pa; then # - # echo -e "set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo" >> /etc/pulse/default.pa + # echo 'set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo' >> /etc/pulse/default.pa # # fi # @@ -7222,13 +7192,10 @@ _EOF_ Create_Desktop_Shared_Items #Odroid C2, define default pulseaudio sink: https://github.com/Fourdee/DietPi/issues/415 - if (( $G_HW_MODEL == 12 )); then - - if ! grep -qi '^set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo' /etc/pulse/default.pa; then + if (( $G_HW_MODEL == 12 )) && + ! grep -qi '^set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo' /etc/pulse/default.pa; then - echo -e "set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo" >> /etc/pulse/default.pa - - fi + echo 'set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo' >> /etc/pulse/default.pa fi @@ -7330,11 +7297,11 @@ _EOF_ # - Stretch , set php7.0 if (( $G_DISTRO == 4 )); then - sed -i "s#/run/php5-fpm.sock#/run/php/php7.0-fpm.sock#g" /etc/nginx/nginx.conf + sed -i 's#/run/php5-fpm.sock#/run/php/php7.0-fpm.sock#g' /etc/nginx/nginx.conf elif (( $G_DISTRO > 4 )); then - sed -i "s#/run/php5-fpm.sock#/run/php/php7.3-fpm.sock#g" /etc/nginx/nginx.conf + sed -i 's#/run/php5-fpm.sock#/run/php/php7.3-fpm.sock#g' /etc/nginx/nginx.conf fi @@ -7551,8 +7518,8 @@ _EOF_ Banner_Configuration #NGINX LIGHTTPD symlink to var www - if (( ${aSOFTWARE_INSTALL_STATE[84]} >= 1 || - ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then + if (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 || + ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then ln -sf /usr/share/phpmyadmin /var/www @@ -9833,9 +9800,7 @@ _EOF_ Download_Test_Media #create/insert our pre-made ampache sql db - G_RUN_CMD wget https://dietpi.com/downloads/mysql_databases/ampache_mysql_3.8.2-v6.0.zip -O sql.zip - G_RUN_CMD unzip -o sql.zip - rm sql.zip + Download_Install 'https://dietpi.com/downloads/mysql_databases/ampache_mysql_3.8.2-v6.0.zip' /DietPi/dietpi/func/create_mysql_db ampache ampache "$GLOBAL_PW" mysql ampache < ampache.sql @@ -9869,7 +9834,7 @@ export KEY_NAME="DietPi_OpenVPN_Server" _EOF_ #Create Server Cert Auth - G_DIETPI-NOTIFY 2 "Generating unique OpenVPN certificates and keys. Please wait...\n" + 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 @@ -10238,8 +10203,8 @@ _EOF_ Banner_Configuration - # - Replace Sysinit service with SystemD - echo -e "#This file is no longer used as service has been upgraded to systemd.\n#Please see /etc/systemd/system/squeezelite.service to set start options" > /etc/default/squeezelite + # - Replace Sysinit service with systemd + echo -e '#This file is no longer used as service has been upgraded to systemd.\n#Please see /etc/systemd/system/squeezelite.service to set start options' > /etc/default/squeezelite rm /etc/init.d/squeezelite cp /DietPi/dietpi/conf/squeezelite.service /etc/systemd/system/squeezelite.service @@ -10267,9 +10232,9 @@ _EOF_ if (( $G_HW_MODEL == 3 )); then # - Add DToverlay to disable bluetooth - if (( ! $(grep -ci -m1 '=pi3-disable-bt' /DietPi/config.txt ) )); then + if ! grep -qi '=pi3-disable-bt' /DietPi/config.txt; then - echo -e "\ndtoverlay=pi3-disable-bt" >> /DietPi/config.txt + echo -e '\ndtoverlay=pi3-disable-bt' >> /DietPi/config.txt # - Enable else @@ -10760,10 +10725,10 @@ _EOF_ # - Lighttpd elif (( ${aSOFTWARE_INSTALL_STATE[84]} >= 1 )); then - echo -e "root:rtorrent:$(echo -n "root:rtorrent:dietpi" | md5sum | cut -b -32)" > /etc/.rutorrent-htaccess + echo "root:rtorrent:$(echo -n 'root:rtorrent:dietpi' | md5sum | cut -b -32)" > /etc/.rutorrent-htaccess # - add to /etc/lighttpd/lighttpd.conf - if (( ! $(grep -ci -m1 '^#RUTORRENT_DIETPI' /etc/lighttpd/lighttpd.conf) )); then + if ! grep -qi '^#RUTORRENT_DIETPI' /etc/lighttpd/lighttpd.conf; then cat << _EOF_ >> /etc/lighttpd/lighttpd.conf #RUTORRENT_DIETPI @@ -11095,7 +11060,7 @@ WantedBy=multi-user.target _EOF_ # - Increase open file limit: - echo -e "fs.inotify.max_user_watches=204800" | tee -a /etc/sysctl.conf + echo 'fs.inotify.max_user_watches=204800' | tee -a /etc/sysctl.conf fi @@ -11206,13 +11171,13 @@ _EOF_ if (( $G_HW_MODEL < 10 )); then # OpenGL - if (( $G_HW_MODEL >= 2 )); then + #if (( $G_HW_MODEL >= 2 )); then - #Hangs xinit: https://github.com/Fourdee/DietPi/issues/834 + # Hangs xinit: https://github.com/Fourdee/DietPi/issues/834 #/DietPi/dietpi/func/dietpi-set_hardware rpi-opengl vc4-kms-v3d - : - fi + #fi + : #OpenGL elif (( $G_HW_MODEL == 21 )); then @@ -12291,11 +12256,7 @@ _EOF_ Banner_Configuration #RPi enable i2c required for GUI - if (( $G_HW_MODEL < 10 )); then - - /DietPi/dietpi/func/dietpi-set_hardware i2c enable - - fi + (( $G_HW_MODEL < 10 )) && /DietPi/dietpi/func/dietpi-set_hardware i2c enable mkdir -p /var/lib/dietpi/dietpi-software/installed/pijuice cat << _EOF_ > /var/lib/dietpi/dietpi-software/installed/pijuice/pijuice_func1.sh @@ -12427,12 +12388,8 @@ _EOF_ if (( $G_HW_MODEL < 10 )); then # - Never override a higher existing value - local current_gpu_mem=$(grep -m1 '^[[:blank:]]*gpu_mem' /DietPi/config.txt | sed 's/^.*=//g') - if (( $current_gpu_mem <= $gpu_memory )); then - - /DietPi/dietpi/func/dietpi-set_hardware gpumemsplit $gpu_memory - - fi + local current_gpu_mem=$(grep -m1 '^[[:blank:]]*gpu_mem' /DietPi/config.txt | sed 's/^[^=]*=//g') + (( $current_gpu_mem <= $gpu_memory )) && /DietPi/dietpi/func/dietpi-set_hardware gpumemsplit $gpu_memory fi @@ -12443,7 +12400,7 @@ _EOF_ #RPi if (( $G_HW_MODEL < 10 )); then - sed -i "/CONFIG_HDMI_OUTPUT=/c\CONFIG_HDMI_OUTPUT=1" /DietPi/dietpi.txt + sed -i '/CONFIG_HDMI_OUTPUT=/c\CONFIG_HDMI_OUTPUT=1' /DietPi/dietpi.txt #odroid C1 elif (( $G_HW_MODEL == 10 )); then From c895a41de8f4df78197cbe5bfa73d277d003b4c0 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 25 Nov 2018 17:02:11 +0100 Subject: [PATCH 02/10] v6.18 + DietPi-Software | Syncthing: Switch to always up-to-date download URL + DietPi-Software | Syncthing: Preserve existing install dir, skipping download&install and inform user instead + DietPi-Software | Syncthing: Install full download dir (especially readme and license) instead of just the binary + DietPi-Software | Syncthing: Place sysctl setting(s) into own sysctl.d/ file --- dietpi/dietpi-software | 54 ++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6916da0d75..a05c14c3df 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5528,31 +5528,38 @@ _EOF_ Banner_Installing - # - armv6+ - if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then + if [[ -d /etc/syncthing]]; then - INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing/releases/download/v0.14.47/syncthing-linux-arm-v0.14.47.tar.gz' + 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. + - if you need to reinstall (e.g. broken instance), please manually backup your config files+data, remove the install dir \"/etc/syncthing\" and rerun \"dietpi-software (re)install $software_id\"." - # - arm64 - elif (( $G_HW_ARCH == 3 )); then + else - INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing/releases/download/v0.14.47/syncthing-linux-arm64-v0.14.47.tar.gz' + INSTALL_URL_ADDRESS='https://api.github.com/repos/syncthing/syncthing/releases/latest' + G_CHECK_URL "$INSTALL_URL_ADDRESS" - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then + # - armv6+ + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then - INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing/releases/download/v0.14.47/syncthing-linux-amd64-v0.14.47.tar.gz' + local arch='arm' - fi + # - arm64 + elif (( $G_HW_ARCH == 3 )); then + + local arch='arm64' - #For some reason checking connection (spider) against the files above fails. - G_CHECK_URL https://github.com/syncthing/syncthing + # - x86_64 + elif (( $G_HW_ARCH == 10 )); then - no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" + local arch='amd64' - mkdir -p /etc/syncthing - cp -R syncthing-*/syncthing /etc/syncthing/ - rm -R syncthing-* + fi + + no_check_url=1 Download_Install "$(curl -s $INSTALL_URL_ADDRESS | grep -m1 "browser_download_url.*linux-$arch-v[0-9.]*tar\.gz" | cut -d \" -f 4)" /etc + mv /etc/syncthing-* /etc/syncthing + + fi fi @@ -11057,11 +11064,11 @@ _EOF_ # Logs/Binary mkdir -p /var/log/syncthing - echo '' > /var/log/syncthing/syncthing.log + >> /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 @@ -11095,7 +11102,7 @@ WantedBy=multi-user.target _EOF_ # - Increase open file limit: - echo -e "fs.inotify.max_user_watches=204800" | tee -a /etc/sysctl.conf + echo 'fs.inotify.max_user_watches=204800' > /etc/sysctl.d/dietpi-syncthing.conf fi @@ -13856,12 +13863,13 @@ _EOF_ Banner_Uninstalling - rm /etc/systemd/system/syncthing.service + [[ -f /etc/systemd/system/syncthing.service ]] && rm /etc/systemd/system/syncthing.service + [[ -f dietpi-syncthing.conf ]] && rm /etc/sysctl.d/dietpi-syncthing.conf # DietPi post-v6.18 - rm /usr/bin/syncthing &> /dev/null # DietPi v158 <= - rm -R /etc/syncthing + [[ -f /usr/bin/syncthing ]] && rm /usr/bin/syncthing # DietPi pre-v158 + [[ -d /etc/syncthing ]] && rm -R /etc/syncthing - rm -R $G_FP_DIETPI_USERDATA/syncthing + [[ -d $G_FP_DIETPI_USERDATA/syncthing ]] && rm -R $G_FP_DIETPI_USERDATA/syncthing fi From fb6d9b3541869279fd284ca87931443696e1f18e Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 25 Nov 2018 17:13:01 +0100 Subject: [PATCH 03/10] v6.18 + DietPi-Software | Syncthing: Syntax --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a05c14c3df..6a09db88bd 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5528,7 +5528,7 @@ _EOF_ 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. From c2027caccaab2ef36bf0a7676f4c1de0adc84f9a Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 25 Nov 2018 17:28:33 +0100 Subject: [PATCH 04/10] v6.18 + DietPi-Software | Syncthing: Installer enhancements --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 80eaa0823a..4860305b27 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -18,6 +18,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Radarr/Sonarr/Lidarr: logs (both .txt and .db*) have been moved to DietPi-RAMlog: https://github.com/Fourdee/DietPi/issues/2223 - DietPi-Software | Pydio: WebUI warnings (security, performance) are now resolved for Nginx and Lighttpd webservers as well. Separate config files are created instead of touching the defaults, to enable required settings for Pydio only. Required PHP modules are installed and enabled, to be failsafe. Preserve existing install dirs on (re)install and inform user to update via WebUI updater: https://github.com/Fourdee/DietPi/issues/1913 - DietPi-Software | Grafana: Existing database/plugin directory and admin password is now preserved on reinstall: https://github.com/Fourdee/DietPi/issues/2267 + - DietPi-Software | Syncthing: Updated installer to always pull the latest release and better handle existing installs. Thanks to @joaofl for bringing this to our attention. Bug Fixes: - PREP: Resovled an issue where master.zip would always be downloaded, regardless of selected branch. From da9411e77ba39afd1f32951fdacfa5ab1a90edd7 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 25 Nov 2018 18:18:45 +0000 Subject: [PATCH 05/10] v6.18 + Handle pivpn pre-req install ourselves: https://github.com/Fourdee/DietPi/pull/2277/ --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 43d13bd45c..c6cbb05d57 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4853,7 +4853,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://install.pivpn.io' G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_AGI lsb-release + G_AGI lsb-release openvpn git tar iptables-persistent dnsutils expect net-tools # - Requires underpriv user: https://github.com/Fourdee/DietPi/issues/570#issuecomment-255588307 useradd pivpn From 0185f6b47fc74852b5ff7bdfd4b47af1594c7dae Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 25 Nov 2018 18:19:33 +0000 Subject: [PATCH 06/10] v6.18 +minor --- dietpi/dietpi-software | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c6cbb05d57..0842312fa8 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2047,6 +2047,7 @@ NB: We highly recommend choosing "Retry" first. Failing that, "NTP mirror" then aSOFTWARE_CATEGORY_INDEX[$software_id]=16 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1 + aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=3469#p3469' aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 @@ -4853,7 +4854,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://install.pivpn.io' G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_AGI lsb-release openvpn git tar iptables-persistent dnsutils expect net-tools + G_AGI lsb-release openvpn tar iptables-persistent dnsutils expect net-tools # - Requires underpriv user: https://github.com/Fourdee/DietPi/issues/570#issuecomment-255588307 useradd pivpn From 47f802fd0b8300557e3bc91d5cbbfb3a0fbb9e15 Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 25 Nov 2018 18:34:22 +0000 Subject: [PATCH 07/10] v6.18 - DietPi-Software | Resolved an issue where rsyslog APT installation would report a failure, due to service failing during APT installation, yet runs fine afterwards: --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4860305b27..f080a24795 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -32,6 +32,7 @@ Bug Fixes: - DietPi-Config | Locale: Resolved an issue where DietPi would always display en_GB as the current locale: https://github.com/Fourdee/DietPi/issues/2216#issuecomment-435599419 - DietPi-Config | Resolved an issue where on Odroid C1/2 with current kernel 3.5" LCD shield does not work anymore. Thanks to @Kreeblah for reporting this issue and solution: https://github.com/Fourdee/DietPi/issues/2256 - DietPi-Automation | CONFIG_NTP_MODE is now applied after APT cache, and, initial time sync is updated. Due to packages required for some modes: https://github.com/Fourdee/DietPi/issues/2181#issuecomment-433444882 + - DietPi-Software | Resolved an issue where rsyslog APT installation would report a failure, due to service failing during APT installation, yet runs fine afterwards: - DietPi-Software | Kodi: Resolved an issue where restart/shutdown options were not visable, due to lack of systemd-logind: https://github.com/Fourdee/DietPi/issues/2155 - DietPi-Software | Mono applications (Radarr/Sonarr/Lidarr/Jackett): Rolled out "-O=-aot" (ahead of time optimzation) to all applications, which resolves a known external bug with recent Mono update. Many thanks to @Generator for testing and confirming this issue: https://github.com/Fourdee/DietPi/issues/2219#issuecomment-437594645 - DietPi-Software | Roon Bridge: Resolved an issue where the remote update would fail due to underpriv permissions: https://community.roonlabs.com/t/dietpi-allo-units-not-getting-the-roonbridge-b167-update-from-b164/52503/6 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 0842312fa8..3fc9b40256 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4854,7 +4854,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://install.pivpn.io' G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_AGI lsb-release openvpn tar iptables-persistent dnsutils expect net-tools + G_AGI lsb-release # - Requires underpriv user: https://github.com/Fourdee/DietPi/issues/570#issuecomment-255588307 useradd pivpn @@ -6752,6 +6752,9 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing + + #Workaround for dpkg failure on 1st install, service does run after its 1st failure...: https://github.com/Fourdee/DietPi/pull/2277/#issuecomment-441460925 + G_ERROR_HANDLER_NO_FAIL=1 G_AGI rsyslog G_AGI rsyslog fi From 6f5415e94945f069ae29bd2eb7d2ad738951d47c Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 25 Nov 2018 18:41:27 +0000 Subject: [PATCH 08/10] v6.18 - DietPi-Software | Resolved an issue where rsyslog APT installation would report a failure, if service was already running previously but not installed via APT (mostly in backup/restore situations): https://github.com/Fourdee/DietPi/pull/2277/#issuecomment-441461982 --- CHANGELOG.txt | 2 +- dietpi/dietpi-software | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f080a24795..6e1a14fcaf 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -32,7 +32,7 @@ Bug Fixes: - DietPi-Config | Locale: Resolved an issue where DietPi would always display en_GB as the current locale: https://github.com/Fourdee/DietPi/issues/2216#issuecomment-435599419 - DietPi-Config | Resolved an issue where on Odroid C1/2 with current kernel 3.5" LCD shield does not work anymore. Thanks to @Kreeblah for reporting this issue and solution: https://github.com/Fourdee/DietPi/issues/2256 - DietPi-Automation | CONFIG_NTP_MODE is now applied after APT cache, and, initial time sync is updated. Due to packages required for some modes: https://github.com/Fourdee/DietPi/issues/2181#issuecomment-433444882 - - DietPi-Software | Resolved an issue where rsyslog APT installation would report a failure, due to service failing during APT installation, yet runs fine afterwards: + - DietPi-Software | Resolved an issue where rsyslog APT installation would report a failure, if service was already running previously but not installed via APT (mostly in backup/restore situations): https://github.com/Fourdee/DietPi/pull/2277/#issuecomment-441461982 - DietPi-Software | Kodi: Resolved an issue where restart/shutdown options were not visable, due to lack of systemd-logind: https://github.com/Fourdee/DietPi/issues/2155 - DietPi-Software | Mono applications (Radarr/Sonarr/Lidarr/Jackett): Rolled out "-O=-aot" (ahead of time optimzation) to all applications, which resolves a known external bug with recent Mono update. Many thanks to @Generator for testing and confirming this issue: https://github.com/Fourdee/DietPi/issues/2219#issuecomment-437594645 - DietPi-Software | Roon Bridge: Resolved an issue where the remote update would fail due to underpriv permissions: https://community.roonlabs.com/t/dietpi-allo-units-not-getting-the-roonbridge-b167-update-from-b164/52503/6 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3fc9b40256..6bfae7291b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6753,9 +6753,10 @@ _EOF_ Banner_Installing - #Workaround for dpkg failure on 1st install, service does run after its 1st failure...: https://github.com/Fourdee/DietPi/pull/2277/#issuecomment-441460925 - G_ERROR_HANDLER_NO_FAIL=1 G_AGI rsyslog + #Workaround for dpkg failure on 1st install if service is already running but APT not installed: https://github.com/Fourdee/DietPi/pull/2277/#issuecomment-441460925 + systemctl stop rsyslog &> /dev/null G_AGI rsyslog + systemctl start rsyslog &> /dev/null fi From 7d522fbd8863375474c8d6f0d398c380c553cb2b Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 25 Nov 2018 19:12:46 +0000 Subject: [PATCH 09/10] v6.18 + Handle pivpn apt packages: https://github.com/Fourdee/DietPi/pull/2277#issuecomment-441464450 --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6bfae7291b..de746509e2 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4854,7 +4854,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://install.pivpn.io' G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_AGI lsb-release + G_AGI lsb-release iptables-persistent dnsutils expect net-tools openvpn # - Requires underpriv user: https://github.com/Fourdee/DietPi/issues/570#issuecomment-255588307 useradd pivpn From ea801025bc644e8b5aaac3fd7315842d0cc17bad Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Sun, 25 Nov 2018 19:25:46 +0000 Subject: [PATCH 10/10] v6.18 + RC beta up --- dietpi/server_version-6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index b6d379bb27..7e226eb556 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 18 -11 +12