Bash · 789 bytes Raw Blame History
1 #!/usr/bin/env bash
2 # FORTRESS wrapper script
3 # Installed to /usr/bin/fortress, calls binary at /usr/lib/fortress/fortress
4 #
5 # Note: This script cannot change your shell's directory. For cd-on-exit
6 # functionality (press 'c' to navigate), source fortress.sh in your shell rc:
7 # source /usr/share/fortress/fortress.sh
8 #
9 # The shell function will take precedence over this script when sourced.
10
11 if [ -n "$FORTRESS_BIN" ] && [ -x "$FORTRESS_BIN" ]; then
12 exec "$FORTRESS_BIN" "$@"
13 elif [ -x "/usr/lib/fortress/fortress" ]; then
14 exec /usr/lib/fortress/fortress "$@"
15 elif [ -x "/usr/lib64/fortress/fortress" ]; then
16 exec /usr/lib64/fortress/fortress "$@"
17 else
18 echo "fortress: binary not found" >&2
19 echo "Set FORTRESS_BIN to override the binary location." >&2
20 exit 1
21 fi