mirror of https://gerrit.osmocom.org/osmo-dev
net: make terminal configurable in config file
Change-Id: I0afb6b0242c399334a2c37f18a5d26d5beeabedc
This commit is contained in:
parent
15efd5cb81
commit
dfca1ff293
|
@ -1,3 +1,7 @@
|
|||
# Terminal for launching Osmocom programs
|
||||
# Supported: auto, urxvt, xterm
|
||||
TERMINAL="auto"
|
||||
|
||||
ETH_DEV=eth0
|
||||
APN_DEV=apn0
|
||||
|
||||
|
|
|
@ -44,10 +44,27 @@ mkdir -p "$logdir"
|
|||
find_term() {
|
||||
# Find a terminal program and write to the global "terminal" variable
|
||||
local programs="urxvt xterm"
|
||||
|
||||
if [ -n "${TERMINAL}" ] && [ "${TERMINAL}" != "auto" ]; then
|
||||
case " $programs " in
|
||||
*" ${TERMINAL} "*)
|
||||
echo "Terminal: ${TERMINAL} (from config)"
|
||||
terminal="${TERMINAL}"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "ERROR: Terminal '${TERMINAL}' is not in list of supported terminals ($programs)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local program
|
||||
for program in $programs; do
|
||||
terminal="$(which $program)"
|
||||
[ -n "$terminal" ] && return
|
||||
if [ -n "$terminal" ]; then
|
||||
echo "Terminal: $program (auto)"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
# No terminal found
|
||||
|
|
Loading…
Reference in New Issue