From 87db75d8cadb65c487efae1ec67e603b61305f47 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Fri, 20 Oct 2023 12:53:21 +1100 Subject: [PATCH] Update m2_card_check.sh --- m2_card_check.sh | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/m2_card_check.sh b/m2_card_check.sh index 570ab87..0b1166f 100644 --- a/m2_card_check.sh +++ b/m2_card_check.sh @@ -1,8 +1,10 @@ #!/bin/bash # Files in /usr/syno/etc and /etc persist after DSM upgrade. -# Files in /usr/syno/etc.defaults and /etc.defaults are replaced during DSM upgrade. -# Files in /run are generated by boot loader at boot. +# Files in /usr/syno/etc.defaults and /etc.defaults are replaced during full DSM upgrade (micro update okay). +# Files in /run are generated when? They persist after micro update. +# +# Seems like /run/adapter_cards.conf generated at boot from /usr/syno/etc.defaults/adapter_cards.conf # # Except for synoinfo.conf which is different in /etc and /usr/syno/etc.defaults, # I should backup files in /etc and /usr/syno/etc @@ -38,7 +40,17 @@ printf '/etc.defaults/synoinfo.conf: '$(get_key_value /etc.defaults/synoinfo.con printf '/etc/synoinfo.conf: '$(get_key_value /etc/synoinfo.conf supportnvme)'\n' -echo -e '\n Checking permissions and owner on model.dtb files' +echo -e '\n Checking permissions and owner of libsynonvme.so.1' +echo " Which should be -rw-r--r-- 1 root root" +ls -l /usr/lib/libsynonvme.so.1 + +echo -e '\n Checking permissions and owner of synonvme' +echo " Which should be -rwxr-xr-x 1 root root" +ls -l /usr/syno/bin/synonvme + + +echo -e '\n Checking permissions and owner of model.dtb files' +echo " Which should be -rw-r--r-- 1 root root" ls -l /etc.defaults/model.dtb ls -l /etc/model.dtb ls -l /run/model.dtb @@ -88,7 +100,8 @@ done error="" -echo -e '\n Checking permissions and owner on adapter_cards.conf files' +echo -e '\n Checking permissions and owner of adapter_cards.conf files' +echo " Which should be -rw-r--r-- 1 root root" ls -l /usr/syno/etc.defaults/adapter_cards.conf ls -l /usr/syno/etc/adapter_cards.conf ls -l /run/adapter_cards.conf @@ -198,14 +211,11 @@ ls /sys/block | grep nv echo -e '\n Checking synostgd-disk log' printf -- '-%.0s' {1..40} && echo echo "Current date/time: $(date +"%Y-%m-%d %T")" -#echo "Last boot date/time: $(who | awk '{print $3,$4}'):00" -bootdate=$(who | awk '{print $3}') -boottime=$(who | awk '{print $4}') -#boottime="10:28" # debug -echo "Last boot date/time: $bootdate $boottime:00" +epoch=$(grep "Current time" /var/log/synobootup.log | tail -1 | awk '{print $8}') +echo "Last boot date/time: $(date -d @$epoch +"%Y-%m-%d %T")" +booted="$(date -d @$epoch +"%Y-%m-%dT%H:%M")" printf -- '-%.0s' {1..40} && echo -#grep synostgd-disk /var/log/messages | tail -10 -grep synostgd-disk /var/log/messages | tail -10 | grep "${bootdate}T$boottime" ||\ +grep synostgd-disk /var/log/messages | tail -10 | grep "${booted}" ||\ echo "No synostgd-disk logs since last boot" printf -- '-%.0s' {1..40} && echo