1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#!/bin/sh -e
# Extra support to produce more meaningful help with '-H' (hence for the man page).
if [ "${1}" = "-H" -o "${1}" = "-h" ]; then
printf "\nEnter a shell tainted via 'ui-auto-env -d'. Any arguments\nyou supply will be added to the 'ui-auto-env' call:\n\n"
$(dirname ${0})/ui-auto-env ${1}
exit 0
fi
# Use configured shell, or /bin/sh as default.
if [ -z "${SHELL}" ]; then
SH_CMD="/bin/sh"
else
SH_CMD="${SHELL}"
fi
CMD="$(dirname ${0})/ui-auto-env -d $@"
if ${CMD} && eval $(${CMD}) 2>/dev/null; then
PS1="ui-auto-shell $@? " exec ${SH_CMD}
else
exit 1
fi
|