]>
Commit | Line | Data |
---|---|---|
86b3ca7a | 1 | #!/bin/sh -eu |
2d9f0c68 ZJS |
2 | |
3 | unitdir="$1" | |
4 | target="$2" | |
5 | unit="$3" | |
6 | ||
7 | case "$target" in | |
b884196c ZJS |
8 | */?*) # a path, but not just a slash at the end |
9 | dir="${DESTDIR:-}${target}" | |
10 | ;; | |
11 | *) | |
12 | dir="${DESTDIR:-}${unitdir}/${target}" | |
13 | ;; | |
2d9f0c68 ZJS |
14 | esac |
15 | ||
dc25d2ad | 16 | unitpath="${DESTDIR:-}${unitdir}/${unit}" |
2d9f0c68 ZJS |
17 | |
18 | case "$target" in | |
b884196c ZJS |
19 | */) |
20 | mkdir -p -m 0755 "$dir" | |
21 | ;; | |
22 | *) | |
23 | mkdir -p -m 0755 "$(basename "$dir")" | |
24 | ;; | |
2d9f0c68 ZJS |
25 | esac |
26 | ||
27 | ln -vfs --relative "$unitpath" "$dir" |