mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-31 14:37:59 +00:00
config/functions: ensure enable_service tells us why it failed
This commit is contained in:
parent
9abd690ad4
commit
e9562ab488
@ -1298,11 +1298,12 @@ add_group() {
|
|||||||
# Usage: enable_service <unit> [target]
|
# Usage: enable_service <unit> [target]
|
||||||
enable_service() {
|
enable_service() {
|
||||||
local unit="$1"
|
local unit="$1"
|
||||||
local unit_dir="/usr/lib/systemd/system"
|
local unit_dir="usr/lib/systemd/system"
|
||||||
local target="$2"
|
local target="$2"
|
||||||
local target_dir=$INSTALL
|
local target_dir=$INSTALL
|
||||||
|
|
||||||
[ -f "$target_dir/$unit_dir/$unit" ] || die
|
[ -f "$target_dir/$unit_dir/$unit" ] || die "ERROR: cannot enable non-existent service $target_dir/$unit_dir/$unit"
|
||||||
|
|
||||||
if [ -z "$target" ] ; then
|
if [ -z "$target" ] ; then
|
||||||
for target in `grep '^WantedBy' $target_dir/$unit_dir/$unit | cut -f2 -d=` ; do
|
for target in `grep '^WantedBy' $target_dir/$unit_dir/$unit | cut -f2 -d=` ; do
|
||||||
if [ -n "$target" ]; then
|
if [ -n "$target" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user