Created
September 14, 2017 02:24
-
-
Save jsfaint/a746565084421929c003895fb74791d8 to your computer and use it in GitHub Desktop.
Push message to wechat via serverchan, when disk space threshold is triggered
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
avail=$(df / | tail -n 1 | awk '{print $4}') | |
threshold="" | |
message="硬盘要满啦" | |
token="" | |
if [[ ${avail:?} -lt ${threshold:?} ]]; then | |
curl "https://sc.ftqq.com/${token:?}.send?text=${message:?}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment