cdist configuration management
Latest manual: https://www.cdi.st/manual/latest/
Home page: https://www.cdi.st
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
494 B
15 lines
494 B
#!/bin/sh -e |
|
|
|
path_is="$( update-alternatives --display "${__object_id:?}" 2>/dev/null \ |
|
| awk '/link currently points to/ {print $5}' )" |
|
|
|
if [ -z "$path_is" ] && [ -z "${__cdist_dry_run+dry run}" ] |
|
then |
|
# NOTE: ignore error for dry-runs because a package providing the |
|
# alternative might be managed by another cdist object (which |
|
# wasn't executed, because dry run…). |
|
echo "unable to get current path for ${__object_id:?}" >&2 |
|
exit 1 |
|
fi |
|
|
|
echo "$path_is"
|
|
|