Adding an error trap - if application fails top stop build fails

This commit is contained in:
Martyn Inglis
2015-12-16 13:20:55 +00:00
parent 033dd40f4e
commit 3d02c97d5c

View File

@@ -1,4 +1,15 @@
#!/bin/bash
function error_exit
{
echo "$1" 1>&2
exit 0
}
echo "Stopping application"
sudo service notifications-api stop
if sudo service notifications-api stop; then
exit 0
else
error_exit "Could not stop application"
fi