forked from davidben/barnowl-locker-bin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
barnowl
executable file
·40 lines (35 loc) · 1.17 KB
/
barnowl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
TERMINFO="$(athdir /mit/barnowl share)"/terminfo
export TERMINFO
eval $(env SHELL=/bin/bash $(athdir /mit/barnowl bin)/barnowl-perl-config)
if [ -n "$ATHENA_SESSION_TMPDIR" ]; then
PAR_GLOBAL_TMPDIR=$ATHENA_SESSION_TMPDIR
export PAR_GLOBAL_TMPDIR
fi
if [ -z "$BARNOWL_REAL" ]; then
BARNOWL_REAL=barnowl.real
fi
case $BARNOWL_REAL in
/*) BARNOWL_REAL_PATH="$BARNOWL_REAL" ;;
*) BARNOWL_REAL_PATH="$(athdir /mit/barnowl bin)/$BARNOWL_REAL" ;;
esac
# Detect zephyr name if necessary
if [ ! -x "$BARNOWL_REAL_PATH" ]; then
SUFFIX=
case $ATHENA_SYS in
*_deb50)
# Both Debian Lenny and Ubuntu Karmic use the _deb50
# sysname, but they have different zephyr versions (soname
# 3 and 4, respectively). So for that sysname, we the
# build script includes the zephyr soname into the binary
# name, and we pick the right one.
if /sbin/ldconfig -p | grep -qF "libzephyr.so.4"; then
SUFFIX=.zephyr4
else
SUFFIX=.zephyr3
fi
;;
esac
BARNOWL_REAL_PATH="$BARNOWL_REAL_PATH$SUFFIX"
fi
exec "$BARNOWL_REAL_PATH" "$@"