もっと自動化

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,13 +1,14 @@
#!/bin/sh
DATE=$(date +"%Y年%m月%d日")
IP=$(ifconfig wg0 | awk '/inet / {print $2; exit}')
echo "192.168.10.106 サーバーパッケージが更新されました。 (${DATE})
echo "${IP} サーバーパッケージが更新されました。 (${DATE})
---------------
" > /root/pkg.txt
/usr/sbin/pkg_add -ui >> /root/pkg.txt
/usr/sbin/syspatch >> /root/pkg.txt
cat /root/pkg.txt | mail -s "192.168.10.106 パッケージ更新 (${DATE})" reports@076.ne.jp
cat /root/pkg.txt | mail -s "${IP} パッケージ更新 (${DATE})" reports@076.ne.jp
rm -rf /root/pkg.txt