tvheadend: suspend/resume: send notifications

This commit is contained in:
Stefan Saraev 2013-04-15 19:34:56 +03:00
parent 961718d13f
commit 844d927cc1

View File

@ -28,10 +28,13 @@ REMOVE_MODULES=`grep REMOVE_MODULES $ADDON_SETTINGS | awk '{print $3 }' | sed -e
LOCKFILE="/var/lock/tvheadend.sleep"
ADDON_DIR="$HOME/.xbmc/addons/service.multimedia.tvheadend"
case "$1" in
hibernate|suspend)
if [ "$(pidof tvheadend)" ];then
progress "Shutting down HTS TVHeadend for suspending..."
xbmc-send -a "Notification(tvheadend, Shutting down HTS TVHeadend for suspend..., 5000, $ADDON_DIR/icon.png)"
tvheadend.stop
touch $LOCKFILE
for module in $REMOVE_MODULES ; do
@ -43,6 +46,7 @@ case "$1" in
thaw|resume)
if [ -f "$LOCKFILE" ] ; then
progress "Restarting HTS TVHeadend for wakeup..."
xbmc-send -a "Notification(tvheadend, Restarting HTS TVHeadend for wakeup..., 5000, $ADDON_DIR/icon.png)"
for module in $REMOVE_MODULES ; do
modprobe $module
done