もっと自動化

This commit is contained in:
2026-05-20 01:12:56 +09:00
parent 62326874ce
commit f315fa45ef
23 changed files with 406 additions and 141 deletions

View File

@@ -1,8 +1,9 @@
#!/bin/sh
DATE=$(date +"%Y年%m月%d日")
IP=$(ifconfig re0 | awk '/inet / {print $2; exit}')
echo "192.168.0.143 NASプールがスクラビングされました。 (${DATE})
echo "${IP} NASプールがスクラビングされました。 (${DATE})
---------------
" > /root/scrub.txt
@@ -14,5 +15,5 @@ echo "ディスク状況:
" >> /root/snap.txt
zpool status >> /root/scrub.txt
cat /root/scrub.txt | mail -s "192.168.0.143 プールスクラビング (${DATE})" reports@076.ne.jp
cat /root/scrub.txt | mail -s "${IP} プールスクラビング (${DATE})" reports@076.ne.jp
rm -rf /root/scrub.txt