cdist/cdist/conf/type/__update_alternatives/explorer/path_is

13 lines
263 B
Bash
Executable File

#!/bin/sh -e
path_is="$( update-alternatives --display "${__object_id:?}" 2>/dev/null \
| awk '/link currently points to/ {print $5}' )"
if [ -z "$path_is" ]
then
echo "unable to get current path for ${__object_id:?}" >&2
exit 1
fi
echo "$path_is"