When you run the script locally on the client, and then run:
Code: Select all
echo $?
Code: Select all
echo $?
Code: Select all
#!/bin/bash
status=$(systemctl status cmmt_revolution)
exitcode=$?
echo "$status" | tr -cd '\11\12\15\40-\176'
if [ $exitcode -eq 0 ]; then
exit 0
else
exit 2
fi