[go: up one dir, main page]

File: ui-auto-shell

package info (click to toggle)
ui-auto 1.2.10-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 784 kB
  • sloc: sh: 3,208; makefile: 50
file content (22 lines) | stat: -rwxr-xr-x 578 bytes parent folder | download | duplicates (7)
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