mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 05:36:47 +00:00
config/functions: add 'enable_service' function to enable systemd services by default
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
b8ea8f2201
commit
a949848a9c
@ -191,6 +191,22 @@ fix_module_depends() {
|
||||
rm new.modinfo*
|
||||
}
|
||||
|
||||
# Usage: enable_service <unit> [target]
|
||||
enable_service () {
|
||||
local unit="$1"
|
||||
local unit_dir="/lib/systemd/system"
|
||||
local target="$2"
|
||||
local target_dir=$INSTALL
|
||||
|
||||
[ -f "$target_dir/$unit_dir/$unit" ] || exit 1
|
||||
[ -z "$target" ] && target=`grep '^WantedBy' $target_dir/$unit_dir/$unit | cut -f2 -d=`
|
||||
|
||||
if [ -n "$target" ]; then
|
||||
mkdir -p ${target_dir}/$unit_dir/${target}.wants
|
||||
ln -sf ../${unit} ${target_dir}/$unit_dir/${target}.wants/
|
||||
fi
|
||||
}
|
||||
|
||||
check_path() {
|
||||
dashes="==========================="
|
||||
if [ "${PWD##/usr}" != "${PWD}" ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user