Lakka-LibreELEC/packages/addons/service/minidlna/source/sleep.d/minidlna.power

26 lines
504 B
Bash

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
. /etc/profile
oe_setup_addon service.minidlna
SERVICE="service.minidlna"
if [ "$RESTART_ON_RESUME" == "true" ] ; then
case "$1" in
pre)
if systemctl is-active "$SERVICE" &>/dev/null ; then
systemctl stop "$SERVICE"
fi
;;
post)
if systemctl is-enabled "$SERVICE" &>/dev/null ; then
systemctl start "$SERVICE"
fi
;;
esac
fi