[__sensible_editor] Remove mixed error reporting from manifest
This commit is contained in:
parent
9e9c3982a8
commit
9a6ca1a343
4 changed files with 14 additions and 19 deletions
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh -e
|
||||||
#
|
#
|
||||||
# 2019 Dennis Camera (dennis.camera at ssrq-sds-fds.ch)
|
# 2019 Dennis Camera (dennis.camera at ssrq-sds-fds.ch)
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh -e
|
||||||
#
|
#
|
||||||
# 2019 Dennis Camera (dennis.camera at ssrq-sds-fds.ch)
|
# 2019 Dennis Camera (dennis.camera at ssrq-sds-fds.ch)
|
||||||
#
|
#
|
||||||
|
@ -22,5 +22,12 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
user=$__object_id
|
user=$__object_id
|
||||||
|
home=$(getent passwd "${user}" | cut -d':' -f6)
|
||||||
|
|
||||||
getent passwd "${user}" | cut -d':' -f6
|
if ! test -d "${home}"
|
||||||
|
then
|
||||||
|
echo "Cannot find home directory of user ${user}" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${home}"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
cdist-type__sensible_editor(7)
|
cdist-type__sensible_editor(7)
|
||||||
============================
|
==============================
|
||||||
|
|
||||||
NAME
|
NAME
|
||||||
----
|
----
|
||||||
|
|
|
@ -24,10 +24,6 @@ os=$(cat "${__global}/explorer/os")
|
||||||
state=$(cat "${__object}/parameter/state")
|
state=$(cat "${__object}/parameter/state")
|
||||||
user=$__object_id
|
user=$__object_id
|
||||||
|
|
||||||
editor_path=$(cat "${__object}/explorer/editor_path")
|
|
||||||
user_home=$(cat "${__object}/explorer/user_home")
|
|
||||||
group=$(cat "${__object}/explorer/group")
|
|
||||||
|
|
||||||
case $os
|
case $os
|
||||||
in
|
in
|
||||||
debian|devuan|ubuntu)
|
debian|devuan|ubuntu)
|
||||||
|
@ -39,17 +35,9 @@ in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if test -z "${user_home}"
|
editor_path=$(cat "${__object}/explorer/editor_path")
|
||||||
then
|
user_home=$(cat "${__object}/explorer/user_home")
|
||||||
echo "Could not find ${user}'s home directory." >&2
|
group=$(cat "${__object}/explorer/group")
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -z "${editor_path}"
|
|
||||||
then
|
|
||||||
echo "Editor \"$(cat "${__object}/parameter/editor")\" is missing on the target system." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
__file "${user_home}/.selected_editor" --state "${state}" \
|
__file "${user_home}/.selected_editor" --state "${state}" \
|
||||||
--owner "${user}" --group "${group}" --mode 0644 \
|
--owner "${user}" --group "${group}" --mode 0644 \
|
||||||
|
|
Loading…
Reference in a new issue