2 ICINGA2_BIN=@CMAKE_INSTALL_FULL_LIBDIR@/icinga2/sbin/icinga2
4 if test "x`uname -s`" = "xLinux" -a "x$1" = "xconsole"; then
5 libedit_line=`ldd $ICINGA2_BIN 2>&1 | grep libedit`
7 libedit_path=`echo $libedit_line | cut -f3 -d' '`
8 if test -n "$libedit_path"; then
9 libdir=`dirname -- $libedit_path`
11 for libreadline_path in `ls -1r -- $libdir/libreadline.so.* 2>/dev/null`; do
15 if test $found -eq 0; then
16 libdir2=/`echo $libdir | cut -f3- -d/`
17 for libreadline_path in `ls -1r -- $libdir2/libreadline.so.* 2>/dev/null`; do
22 if test $found -gt 0; then
23 export LD_PRELOAD="$libreadline_path:$LD_PRELOAD"
29 exec $ICINGA2_BIN "$@"