From bd6d27e378cc6acbc52de27f484bdd4f99d1a0a6 Mon Sep 17 00:00:00 2001 From: rern Date: Sat, 8 Oct 2022 14:12:26 +0700 Subject: [PATCH 1/3] Update install.sh --- install.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/install.sh b/install.sh index 80e0d5c56..750d5c191 100644 --- a/install.sh +++ b/install.sh @@ -7,16 +7,9 @@ dir=/srv/http/shareddata dirshareddata=/mnt/MPD/NAS/data filesharedip=$dirshareddata/sharedip if [[ -e $dir ]]; then - if [[ -e $filesharedip ]]; then - list=$( cat $filesharedip ) - else - echo data > /mnt/MPD/NAS/.mpdignore - mkdir -p $dirshareddata - list=$( grep $dir /etc/fstab | sed 's|^//||; s|/.*||; s|:.*||' ) - fi - echo "\ -$list -$( ifconfig | grep -m1 inet.*broadcast | awk '{print $2}' )" | sort -u > $filesharedip + echo data > /mnt/MPD/NAS/.mpdignore + mkdir -p $dirshareddata + mv $dir/iplist > $filesharedip chmod 777 $filesharedip umount -l $dir sed -i "s|$dir|$dirshareddata|" /etc/fstab From 943da46624fe19320c594dabbd56bbe7cc40199c Mon Sep 17 00:00:00 2001 From: rern Date: Mon, 10 Oct 2022 18:47:02 +0700 Subject: [PATCH 2/3] Update install.sh --- install.sh | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/install.sh b/install.sh index 750d5c191..4c058beb9 100644 --- a/install.sh +++ b/install.sh @@ -3,21 +3,6 @@ alias=r1 # 20221005 -dir=/srv/http/shareddata -dirshareddata=/mnt/MPD/NAS/data -filesharedip=$dirshareddata/sharedip -if [[ -e $dir ]]; then - echo data > /mnt/MPD/NAS/.mpdignore - mkdir -p $dirshareddata - mv $dir/iplist > $filesharedip - chmod 777 $filesharedip - umount -l $dir - sed -i "s|$dir|$dirshareddata|" /etc/fstab - systemctl daemon-reload - mount $dirshareddata - rmdir $dir -fi - [[ -e /srv/http/data/system/hddspindown ]] && mv /srv/http/data/system/{hddspindown,apm} if [[ ! -e /boot/kernel.img ]]; then From d92961bab8551fd7788bd02d0e453685c62dc800 Mon Sep 17 00:00:00 2001 From: rern Date: Tue, 11 Oct 2022 09:12:42 +0700 Subject: [PATCH 3/3] Update system-data.sh --- srv/http/bash/settings/system-data.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/srv/http/bash/settings/system-data.sh b/srv/http/bash/settings/system-data.sh index 47b9fd189..fb0695c3e 100644 --- a/srv/http/bash/settings/system-data.sh +++ b/srv/http/bash/settings/system-data.sh @@ -13,9 +13,9 @@ $( [[ $startup ]] && echo "$startup(kernel + userspace)/dev/tcp/8.8.8.8/53 && status+="
 No Internet connection" throttled=$( /opt/vc/bin/vcgencmd get_throttled | cut -d= -f2 ) if [[ $throttled == 0x1 ]]; then # https://www.raspberrypi.org/documentation/raspbian/applications/vcgencmd.md - status+="
 Voltage under 4.7V - detected now $throttled" + status+="
 Voltage under 4.7V - detected now 0x1" elif [[ $throttled == 0x10000 ]]; then - status+="
 Voltage under 4.7V - occurred $throttled" + status+="
 Voltage under 4.7V - occurred 0x10000" fi # for interval refresh [[ $1 == status ]] && echo $status && exit @@ -104,7 +104,9 @@ if [[ $usb ]]; then [[ ! $label ]] && label=? list+=',{"icon":"usbdrive","mountpoint":"/mnt/MPD/USB/'$label'","mounted":false,"source":"'$source'"}' fi - [[ ! $hddapm ]] && hddapm=$( hdparm -B $source | grep -m1 APM_level | awk '{print $NF}' ) + [[ ! $hddapm ]] && hddapm=$( hdparm -B $source \ + | grep -m1 APM_level \ + | tr -d -c 0-9 ) done fi nas=$( awk '/.mnt.MPD.NAS|.srv.http.data/ {print $1" "$2}' /etc/fstab | sort )