Skip to content

Commit

Permalink
v7.8 (#4918)
Browse files Browse the repository at this point in the history
+ DietPi-Software | DietPi-Dashboard: Thanks to the great work of @ravenclaw900, we are proud to announce our own official DietPi web interface for monitoring and managing your DietPi system using your web browser. It is still in beta phase as we test and gradually implement more features. We would be happy if you would try it out via "dietpi-software install 200" and give us feedback: #448
+ DietPi-Services | When printing the status, instead of removing a hardcoded number of 11 characters from the start of the line, remove the first field and delimiter. The number of leading spaces has changed with Bullseye, so that the colon of "Active:" was shown unintentionally.
  • Loading branch information
ravenclaw900 authored Nov 6, 2021
1 parent eda313f commit 2cf4b3e
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 47 deletions.
1 change: 1 addition & 0 deletions .meta/dietpi-survey_report
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ shopt -s extglob
done
unset -v 'aSOFTWARE_NAME7_8[34]' # Subsonic
unset -v 'aSOFTWARE_NAME7_8[99]' # emonHub
aSOFTWARE_NAME7_8[200]='DietPi-Dashboard'

# Pre-create software counter array so that we can see also software (available in newest version) with 0 installs
for i in "${aSOFTWARE_NAME7_8[@]}"
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ New SBC support:
- Radxa Zero | Initial support for this Raspberry Pi Zero form factored (but way more powerful) SBC has been added to DietPi with the hardware ID 74. Many thanks to @almirus and @dhry for helping with testing and debugging an early image: https://github.com/MichaIng/DietPi/issues/4831
- Raspberry Pi Zero 2 W | Initial support for this Raspberry Pi Zero/Zero W successor has been added, using hardware ID 3 for now (shared with RPi 3/3+), including overclocking profiles. Many thank to @CassTG for providing early hardware information and doing intensive overclocking tests: https://dietpi.com/phpbb/viewtopic.php?t=9599

New software:
- DietPi-Dashboard | Thanks to the great work of @ravenclaw900, we are proud to announce our own official DietPi web interface for monitoring and managing your DietPi system using your web browser. It is still in beta phase as we test and gradually implement more features. We would be happy if you would try it out via "dietpi-software install 200" and give us feedback: https://github.com/MichaIng/DietPi/issues/448

Removed software:
- Subsonic | Since it is not developed anymore and due to shared library dependencies only compatible with Debian Stretch, we removed Subsonic from DietPi-Software. With Airsonic-Advanced, we'll provide a well maintained and Bullseye-compatible alternative. If you currently have Subsonic installed, it will remain. If you want to uninstall it, follow the instructions here: https://github.com/MichaIng/DietPi/pull/4895
- emonHub | Since we do not have a single reported installation, we removed emonHub from DietPi-Software. If you currently have emonHub installed, it will remain. If you want to keep using and updating it, have a look at the official repository: https://github.com/openenergymonitor/emonhub. If you want to uninstall it, follow the instructions here: https://github.com/MichaIng/DietPi/pull/4895
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ Links to hardware and software manufacturers, sources and build instructions use
- [Blynk Server](https://github.com/Peterkn2001/blynk-server)
- [File Browser](https://github.com/filebrowser/filebrowser)
- [Spotifyd](https://github.com/Spotifyd/spotifyd)
- [DietPi-Dashboard](https://github.com/ravenclaw900/dietpi-dashboard)

---

Expand Down
6 changes: 6 additions & 0 deletions dietpi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ SOFTWARE_HOMEASSISTANT_PIP_DEPS=
# https://rancher.com/docs/k3s/latest/en/installation/install-options/#configuration-file
SOFTWARE_K3S_EXEC=

# DietPi-Dashboard
# Version to use
# - Stable = Use release version of DietPi-Dashboard.
# - Nightly = Use unstable version DietPi-Dashboard. Might have bugs, but will probably have more features.
SOFTWARE_DIETPI_DASHBOARD_VERSION=Stable

#------------------------------------------------------------------------------------------------------
##### Dev settings #####
#------------------------------------------------------------------------------------------------------
Expand Down
49 changes: 2 additions & 47 deletions dietpi/dietpi-services
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ Available services:

# DietPi
aSERVICE_NAME+=('dietpi-vpn') # NordVPN install + client
aSERVICE_NAME+=('dietpi-dashboard') # Web Dashboard
if [[ $INPUT_CMD == 'status' ]]; then

aSERVICE_NAME+=('dietpi-ramlog')
Expand Down Expand Up @@ -275,7 +276,6 @@ _EOF_

while read -r line
do

# Include
if [[ $line == '+ '* ]]; then

Expand All @@ -284,9 +284,7 @@ _EOF_
# - Skip known services
for i in "${aSERVICE_NAME[@]}"
do

[[ $line == "$i" ]] && continue 2

done

[[ $G_DEBUG == 1 ]] && G_DIETPI-NOTIFY 2 "Including custom service: $line"
Expand All @@ -299,7 +297,6 @@ _EOF_

for i in "${!aSERVICE_NAME[@]}"
do

[[ $line == "${aSERVICE_NAME[$i]}" ]] || continue

# Show in menu, but mark as excluded
Expand All @@ -315,7 +312,6 @@ _EOF_
fi

break

done

fi
Expand All @@ -339,26 +335,22 @@ _EOF_
local i j
for i in "${!aSERVICE_NAME[@]}"
do

[[ ${aSERVICE_NAME[$i]} ]] || { unset -v "aSERVICE_NAME[$i]"; continue; } # Failsafe

# Check for sysvinit services from systemd-sysv-generator dir: /run/systemd/generator.late/
for j in /{{etc,usr/local/lib,lib,usr/lib}/systemd/system,run/systemd/generator.late}/"${aSERVICE_NAME[$i]}.service"
do

[[ -e $j ]] || continue

# Check masked state, in case continue to catch real file
[[ -L $j && $(readlink -m "$j") == '/dev/null' ]] && aSERVICE_MODE[$i]='masked' && continue

aFP_SERVICE[$i]=$j
break

done

# Remove non-available services from array
[[ ${aFP_SERVICE[$i]} ]] || unset -v "aSERVICE_NAME[$i]"

done

}
Expand Down Expand Up @@ -387,9 +379,7 @@ _EOF_

for i in "${!aSERVICE_NAME[@]}"
do

services="$i $services"

done

# - start/restart: Standard service order
Expand All @@ -410,12 +400,10 @@ _EOF_
# Apply command
for i in $services
do

[[ ${aSERVICE_MODE[$i]} == 'masked' ]] && { G_DIETPI-NOTIFY 2 "skip : ${aSERVICE_NAME[$i]} (due to mask)"; continue; }
G_DIETPI-NOTIFY -2 "${aSERVICE_NAME[$i]}"
systemctl "$command" "${aSERVICE_NAME[$i]}" &> /dev/null
Print_Status "$command" "${aSERVICE_NAME[$i]}" $?

done

# Disable ownCloud and Nextcloud maintenance mode after all services being started or restarted
Expand Down Expand Up @@ -449,12 +437,11 @@ _EOF_
local status_full space status
for i in $services
do

status_full=$(systemctl -l --no-pager status "${aSERVICE_NAME[$i]}")
# Align status output
space='\t'
(( ${#aSERVICE_NAME[$i]} < 13 )) && space+='\t'; (( ${#aSERVICE_NAME[$i]} < 5 )) && space+='\t'
status="${aSERVICE_NAME[$i]}${space}$(mawk '/Active/{print substr($0,12);exit}' <<< "$status_full")"
status="${aSERVICE_NAME[$i]}${space}$(mawk '/Active:/{$1="";print;exit}' <<< "$status_full")"; status=${status# }
if [[ $status == *'failed'* ]]; then

G_DIETPI-NOTIFY 1 "$status_full"
Expand All @@ -468,7 +455,6 @@ _EOF_
G_DIETPI-NOTIFY 0 "$status"

fi

done

# dietpi_controlled/systemd_controlled/mask/unmask/enable/disable
Expand Down Expand Up @@ -504,12 +490,10 @@ _EOF_
# Apply command
for i in $services
do

# Skip masked services, if not to be unmasked
[[ ${aSERVICE_MODE[$i]} == 'masked' && $systemctl_cmd != 'unmask' ]] && { G_DIETPI-NOTIFY 2 "skip : ${aSERVICE_NAME[$i]} (due to mask)"; continue; }
systemctl $systemctl_cmd "${aSERVICE_NAME[$i]}" &> /dev/null
Print_Status "$command" "${aSERVICE_NAME[$i]}" $?

done

fi
Expand Down Expand Up @@ -620,10 +604,8 @@ _EOF_

for i in "${!aSERVICE_NAME[@]}"
do

aSERVICE_MODE[$i]=$(systemctl is-enabled "${aSERVICE_NAME[$i]}" 2> /dev/null)
Load_Process_Tool "$i"

done

}
Expand All @@ -648,7 +630,6 @@ _EOF_
local service_restart_list_menu aservice_restart_list_systemd=() i
for i in "${!aSERVICE_RESTART_REQUIRED[@]}"
do

service_restart_list_menu+="\n - ${aSERVICE_NAME[$i]}: "
[[ ${aCPU_AFFINITY[$i]} ]] && service_restart_list_menu+="Affinity=${aCPU_AFFINITY[$i]} | "
[[ ${aCPU_POLICY[$i]} ]] && service_restart_list_menu+="CPU Scheduling Policy=${aCPU_POLICY[$i]} | "
Expand All @@ -657,7 +638,6 @@ _EOF_
[[ ${aIO_CLASS[$i]} ]] && service_restart_list_menu+="I/O Scheduling Class=${aIO_CLASS[$i]} | "
[[ ${aIO_PRIORITY[$i]} ]] && service_restart_list_menu+="I/O Scheduling Priority=${aIO_PRIORITY[$i]} | "
aservice_restart_list_systemd+=("${aSERVICE_NAME[$i]}")

done

if [[ ${aservice_restart_list_systemd[0]} ]] && G_WHIP_YESNO "[ INFO ] The following services require a restart, in order to apply your chosen settings:${service_restart_list_menu%[|:] }
Expand Down Expand Up @@ -685,9 +665,7 @@ _EOF_
G_WHIP_MENU_ARRAY=('' '●─ Single Service Options ')
for i in "${!aSERVICE_NAME[@]}"
do

G_WHIP_MENU_ARRAY+=("${aSERVICE_NAME[$i]}" ": $(systemctl is-active "${aSERVICE_NAME[$i]}") | Affinity ${aCPU_AFFINITY[$i]:-0-$(( $G_HW_CPU_CORES - 1 ))}")

done
G_WHIP_MENU_ARRAY+=(

Expand All @@ -710,29 +688,23 @@ _EOF_
# Find first empty index
for ((i=0;i<=${#aSERVICE_MODE[@]};i++))
do

[[ ${aSERVICE_NAME[$i]} ]] || { new_index=$i; break; }

done
while G_WHIP_INPUTBOX "${not_found}Please add the name of the service to be added, without the \".service\" file ending:"
do

if [[ $G_WHIP_RETURNED_VALUE ]]; then

# Check for known services
for i in "${aSERVICE_NAME[@]}"
do

[[ $G_WHIP_RETURNED_VALUE == "$i" ]] || continue

not_found="[FAILED] The service name you entered ($G_WHIP_RETURNED_VALUE) is already handled by DietPi-Services. Please retry or cancel.\n\n"
continue 2

done

for i in /{{etc,usr/local/lib,lib,usr/lib}/systemd/system,run/systemd/generator.late}/"$G_WHIP_RETURNED_VALUE.service"
do

[[ -f $i ]] || continue

aSERVICE_NAME[$new_index]=$G_WHIP_RETURNED_VALUE
Expand All @@ -741,13 +713,11 @@ _EOF_
Load_Process_Tool "$new_index"
G_CONFIG_INJECT "+ ${aSERVICE_NAME[$new_index]}" "+ ${aSERVICE_NAME[$new_index]}" $FP_INCLUDE_EXCLUDE
break 2

done

fi

not_found="[FAILED] Could not find a service file that matches your input ($G_WHIP_RETURNED_VALUE). Please retry or cancel.\n\n"

done

elif [[ $G_WHIP_RETURNED_VALUE == 'Restart' || $G_WHIP_RETURNED_VALUE == 'Stop' ]]; then
Expand All @@ -763,11 +733,9 @@ _EOF_
MENU_SERVICE_INDEX=-1
for i in "${!aSERVICE_NAME[@]}"
do

[[ ${aSERVICE_NAME[$i]} == "$G_WHIP_RETURNED_VALUE" ]] || continue
MENU_SERVICE_INDEX=$i
break

done
(( $MENU_SERVICE_INDEX >= 0 )) && MENU_TARGETID=1

Expand Down Expand Up @@ -974,9 +942,7 @@ Please uncomment and edit only the lines that you need to change.\n\nTo undo cha
G_WHIP_CHECKLIST_ARRAY=()
for ((i=0; i<$G_HW_CPU_CORES; i++))
do

G_WHIP_CHECKLIST_ARRAY+=("$i" 'CPU ' 'on')

done

if G_WHIP_CHECKLIST "Please select the desired CPU Affinity for: ${aSERVICE_NAME[$MENU_SERVICE_INDEX]}\n
Expand All @@ -985,10 +951,8 @@ Please uncomment and edit only the lines that you need to change.\n\nTo undo cha
local new_affinity=
for i in $G_WHIP_RETURNED_VALUE
do

# taskset requires comma-seperated CPU indices
[[ $new_affinity ]] && new_affinity+=",$i" || new_affinity=$i

done

# Update affinity array with new value, if at least 1 item was selected, otherwise reset
Expand All @@ -1003,9 +967,7 @@ Please uncomment and edit only the lines that you need to change.\n\nTo undo cha
G_WHIP_MENU_ARRAY=('Reset' ': Reset CPU Scheduling Policy to system defaults')
for i in "${!aCPU_POLICY_TYPE[@]}"
do

G_WHIP_MENU_ARRAY+=("${aCPU_POLICY_TYPE[$i]}" ": ${aCPU_POLICY_DESC[$i]}" )

done

G_WHIP_DEFAULT_ITEM=$cpu_policy
Expand Down Expand Up @@ -1086,7 +1048,6 @@ Info:\n - Negative values have a higher priority (eg: -10).\n - Positive values
G_WHIP_MENU_ARRAY=('Reset' ': Reset CPU Scheduling Priority to system defaults')
for ((i=$scale_value_highest; i>=$scale_value_lowest; i--))
do

if (( $i == $scale_value_lowest )); then

desc='(Lowest priority)'
Expand Down Expand Up @@ -1122,7 +1083,6 @@ Info:\n - Negative values have a higher priority (eg: -10).\n - Positive values
fi

G_WHIP_MENU_ARRAY+=("$i" ": $desc")

done

G_WHIP_DEFAULT_ITEM=$cpu_priority
Expand All @@ -1140,9 +1100,7 @@ Info:\n - Negative values have a higher priority (eg: -10).\n - Positive values
G_WHIP_MENU_ARRAY=('Reset' ': Reset I/O Scheduling Class to system defaults')
for i in "${!aIO_CLASS_TYPE[@]}"
do

G_WHIP_MENU_ARRAY+=("${aIO_CLASS_TYPE[$i]}" ": ${aIO_CLASS_DESC[$i]}" )

done

G_WHIP_DEFAULT_ITEM=$io_class
Expand Down Expand Up @@ -1179,7 +1137,6 @@ NB: This only has an effect on drives handled by the CFQ scheduler.\nRead about
fi

G_WHIP_MENU_ARRAY+=("$i" ": $desc")

done

G_WHIP_DEFAULT_ITEM=$io_priority
Expand Down Expand Up @@ -1263,7 +1220,6 @@ NB: This only has an effect on drives handled by the CFQ scheduler."; then

until (( $MENU_TARGETID < 0 ))
do

if (( $MENU_TARGETID == 1 )); then

Menu_Service
Expand All @@ -1273,7 +1229,6 @@ NB: This only has an effect on drives handled by the CFQ scheduler."; then
Menu_Main

fi

done

fi
Expand Down
Loading

0 comments on commit 2cf4b3e

Please sign in to comment.