summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2013-05-05 23:07:06 +0200
committerJouke Witteveen <j.witteveen@gmail.com>2013-05-05 23:07:06 +0200
commit2587acda28156f50149a15cad67d0c0bc1eb0bb4 (patch)
tree5b9a1cccd3a513caddc171bc76b38428eeaa78be /src
parent11f6a8ce077bf403cf0b1945f8385a6653162c05 (diff)
downloadnetctl-2587acda28156f50149a15cad67d0c0bc1eb0bb4.tar.gz
netctl-2587acda28156f50149a15cad67d0c0bc1eb0bb4.tar.xz
Use pkg-config to obtain the systemd system unit directory
This ensures the units are installed correctly if systemd is installed in an alternate location like /lib/systemd. Idem for the location of profile-based units. Based on a proposal by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r--[-rwxr-xr-x]src/netctl.in (renamed from src/netctl)6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/netctl b/src/netctl.in
index 4441838..2d04d28 100755..100644
--- a/src/netctl
+++ b/src/netctl.in
@@ -100,13 +100,13 @@ switch_to() {
}
unit_enable() {
- local unit="/etc/systemd/system/netctl@$(sd_escape "$1").service"
+ local unit="@systemdsystemconfdir@/netctl@$(sd_escape "$1").service"
if [[ -e $unit ]]; then
report_error "A unit file for profile '$1' already exists"
return 1
fi
load_profile "$1"
- echo ".include /usr/lib/systemd/system/netctl@.service" > "$unit"
+ echo ".include @systemdsystemunitdir@/netctl@.service" > "$unit"
echo -e "\n[Unit]" >> "$unit"
[[ -n $Description ]] && echo "Description=$Description" >> "$unit"
if [[ -n ${BindsToInterfaces=$Interface} ]]; then
@@ -126,7 +126,7 @@ unit_enable() {
}
unit_disable() {
- local unit="/etc/systemd/system/netctl@$(sd_escape "$1").service"
+ local unit="@systemdsystemconfdir@/netctl@$(sd_escape "$1").service"
if sd_call "is-enabled --quiet" "$1" &> /dev/null; then
sd_call disable "$1"
fi