Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- /usr/bin/samba-tool drs showrepl -d0 2>&1 > /tmp/showrepl
- dc="DC2"
- expected_failure=0
- expected_success=20
- failure=$(grep -c "failed" /tmp/showrepl)
- success=$(grep -c "successful" /tmp/showrepl)
- if [ $failure -ne $expected_failure ]; then
- cat /tmp/showrepl | mail -s "FAILURE: unexpected showrepl result on $dc" system-status@company.com
- echo "failures don't match"
- fi
- if [ $success -ne $expected_success ]; then
- cat /tmp/showrepl | mail -s "FAILURE: unexpected showrepl result on $dc" system-status@company.com
- echo "successes don't match"
- fi
- if [ $failure -eq $expected_failure ] && [ $success -eq $expected_success ]; then
- echo "all is well"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement