File tree 2 files changed +45
-0
lines changed
2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ Some small and simple scripts used by me for for various tasks. Most of them tes
9
9
* gmirror-rebuild.sh - run gmirror rebuild for stale components after full server startup
10
10
* grabssh - fix ssh-agent forwarding when attaching to an existing [ tmux] ( http://tmux.sourceforge.net/ ) or screen
11
11
* hdd-r-speed.sh - run short read benchmark for all HDD
12
+ * inventory-save.sh - save hardware information as text files in ` /var/db/inventory `
12
13
* jpeg2pdf.sh - pack several jpeg images into single pdf file (wrapper around [ gs] ( http://www.ghostscript.com/ ) )
13
14
* lib_check.sh - list dynamic executables that have unresolvable shared library links
14
15
* ozi-map-merge.pl - generate Global Mapper script to merge raster maps (georeferenced by OziExplorer)
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ PATH=/bin:/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
6
+
7
+ cd /var/db/inventory || exit 1
8
+
9
+ if kldstat -q -m g_mirror; then
10
+ gmirror status -s | sort > gmirror.txt
11
+ elif [ -f gmirror.txt ]; then
12
+ rm gmirror.txt
13
+ fi
14
+
15
+ if [ -c /dev/zfs ]; then
16
+ zpool status | grep -Fv ' scan:' > zpool.txt
17
+ elif [ -f zpool.txt ]; then
18
+ rm zpool.txt
19
+ fi
20
+
21
+ if [ $( id -u) -ne 0 ]; then
22
+ SUDO=sudo
23
+ else
24
+ SUDO=' '
25
+ fi
26
+
27
+ $SUDO dmidecode --quiet > dmidecode.txt
28
+
29
+ rm -f disk_* .txt
30
+
31
+ for d in $( sysctl -n kern.disks) ; do
32
+ case $d in
33
+ # skip removable devices
34
+ cd[0-9] | mmcsd[0-9] )
35
+ ;;
36
+ * )
37
+ disk_list=" $disk_list $d "
38
+ ;;
39
+ esac
40
+ done
41
+
42
+ for d in $disk_list ; do
43
+ $SUDO smartctl --info /dev/${d} | awk ' NR > 3 && ! /Local Time/' > disk_${d} .txt
44
+ done
You can’t perform that action at this time.
0 commit comments