summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-09-21 15:12:58 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-09-21 15:12:58 (GMT)
commite235a08c001227e1258b4c23b1c1e9bbe63d3256 (patch)
treec8335ebbec6f4cd5959503fc0975b012a95148dd
parent397663589accedf4566712eb371ab3bb21f33d67 (diff)
downloadlinhes_pkgbuild-e235a08c001227e1258b4c23b1c1e9bbe63d3256.zip
linhes_pkgbuild-e235a08c001227e1258b4c23b1c1e9bbe63d3256.tar.gz
linhes_pkgbuild-e235a08c001227e1258b4c23b1c1e9bbe63d3256.tar.bz2
LinHES-config: backend_control.sh add the ability to detect if func failed and attempt to display the msg using local msg_client.py
-rwxr-xr-xabs/core/LinHES-config/PKGBUILD4
-rwxr-xr-xabs/core/LinHES-config/backend_control.sh66
2 files changed, 46 insertions, 24 deletions
diff --git a/abs/core/LinHES-config/PKGBUILD b/abs/core/LinHES-config/PKGBUILD
index e1879b9..a5b0db5 100755
--- a/abs/core/LinHES-config/PKGBUILD
+++ b/abs/core/LinHES-config/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=LinHES-config
pkgver=2.3
-pkgrel=140
+pkgrel=141
conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev LinHes-config )
pkgdesc="Install and configure your system"
depends=('bc' 'libstatgrab' 'mysql-python' 'expect' 'curl' 'dnsutils' 'parted'
@@ -169,4 +169,4 @@ md5sums=('d27979591231e647f59c23ae18a3d37b'
'6ec39b010c0ed8901ea896c7e153d330'
'3866086e6af5e3528a66eff492f2f4dd'
'c9279fa095af624ee3d9bc75d3328360'
- '66a5e2dd3e51d11a93a17f7c01a8708f')
+ 'a0df3d90e4a0da6781e45414a5f1b754')
diff --git a/abs/core/LinHES-config/backend_control.sh b/abs/core/LinHES-config/backend_control.sh
index 24c6551..07ff162 100755
--- a/abs/core/LinHES-config/backend_control.sh
+++ b/abs/core/LinHES-config/backend_control.sh
@@ -6,39 +6,61 @@ COMMAND=$1
BETYPE=$2
eval LAST=\$$#
dbhost=`echo $LAST`
-
-
+hostname=`hostname`
MESSAGE=""
+
case $COMMAND in
- stop) MESSAGE=`/usr/bin/curl http://$dbhost:1337/bestop.cgi 2>/dev/null`
+ stop) MESSAGE=`/usr/bin/curl http://$dbhost:1337/bestop.cgi 2>/dev/null`
rc=$?
+
if [ $rc != 0 ]
then
lh_message.sh "Could not stop the backend."
+ else
+ echo "$MESSAGE" | grep -q "'$hostname': 'Message delivered'"
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ msg_client.py "* Backend Stopped" > /dev/null
+ fi
fi
- ;;
+ ;;
- start )
- MESSAGE=`/usr/bin/curl http://$dbhost:1337/bestart.cgi 2>/dev/null`
- rc=$?
- if [ $rc != 0 ]
- then
+ start )
+ MESSAGE=`/usr/bin/curl http://$dbhost:1337/bestart.cgi 2>/dev/null`
+ rc=$?
+ if [ $rc != 0 ]
+ then
lh_message.sh "Could not start the backend"
- fi
- ;;
+ else
+ echo "$MESSAGE" | grep -q "'$hostname': 'Message delivered'"
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ msg_client.py "* Backend Started" > /dev/null
+ fi
+ fi
+ ;;
- restart)
- /usr/MythVantage/bin/backend_control.sh stop $dbhost
- sleep 2
- /usr/MythVantage/bin/backend_control.sh start $dbhost
+ restart)
+ /usr/MythVantage/bin/backend_control.sh stop $dbhost
+ sleep 2
+ /usr/MythVantage/bin/backend_control.sh start $dbhost
+ ;;
- ;;
- clearcache)
- MESSAGE2=`/usr/bin/curl http://$dbhost:1337/beclear.cgi 2>/dev/null`
- rc=$?
- if [ $rc != 0 ]
- then
+ clearcache)
+ MESSAGE2=`/usr/bin/curl http://$dbhost:1337/beclear.cgi 2>/dev/null`
+ rc=$?
+ if [ $rc != 0 ]
+ then
lh_message.sh "Could not clear the cache"
- fi
+ else
+ echo "$MESSAGE" | grep -q "'$hostname': 'Message delivered'"
+ rc=$?
+ if [ $rc != 0 ]
+ then
+ msg_client.py "* cache cleared" > /dev/null
+ fi
+ fi
esac