Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # This is sample script of the send mail for pwrstatd daemon using.
- #
- #!/bin/sh
- SUBJECT="PowerPanel Notification - [$EVENT]"
- MESSAGE="Warning: The $EVENT event has occurred for a while, system will be shutdown immediately!"
- DATE=`date +'%Y/%m/%d %p %H:%M'`
- test ${#DATE}
- RUNTIME=""
- if [ $REMAINING_RUNTIME != none ]; then
- RUNTIME="Remaining Runtime: $REMAINING_RUNTIME Seconds"
- fi
- DATA="
- ========================================================
- $SUBJECT
- ========================================================
- $MESSAGE
- Time: $DATE
- UPS Model Name: $MODEL_NAME
- Battery Capacity: $BATTERY_CAPACITY %
- $RUNTIME"
- echo "$DATA" | mail \
- -s "$SUBJECT" \
- -r $SENDER_ADDRESS \
- $RECEIPT_ADDRESS
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement