auto
  $   ˆl–Ým_Jõ2ÛR‚ „ …pLÜe•1hßÁ…mÖÜpÀ¿ ?÷     #!/usr/bin/sh

#
# rkhunter -- Scan the system for rootkits and other known security issues.
#
# Copyright (c) 2003-2017, Michael Boelen ( michael AT rootkit DOT nl )
#
#     This program is free software; you can redistribute it and/or modify
#     it under the terms of the GNU General Public License as published by
#     the Free Software Foundation; either version 2 of the License, or
#     (at your option) any later version.
#
#     This program is distributed in the hope that it will be useful,
#     but WITHOUT ANY WARRANTY; without even the implied warranty of
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#     GNU General Public License for more details.
#
#     You should have received a copy of the GNU General Public License
#     along with this program; if not, write to the Free Software
#     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
#


#
# Unfortunately we must do some O/S checks at the very beginning,
# otherwise SunOS will complain about some of the ksh/bash syntax.
# By default the SunOS root account uses a simple Bourne shell,
# which does not work with RKH. So we exec to use the Bash shell
# if it is present, or the Korn shell which is usually installed
# by default on Solaris systems.
#

BSDOS=0
SUNOS=0
BUSYBOX=0

OPERATING_SYSTEM=`uname 2>/dev/null`

case "${OPERATING_SYSTEM}" in
*BSD|DragonFly)
	BSDOS=1
	unset CLICOLOR CLICOLOR_FORCE
	;;
SunOS)
	SUNOS=1
	unset CLICOLOR CLICOLOR_FORCE
	;;
esac

if [ $SUNOS -eq 1 ]; then
	# Simple SunOS test of RANDOM to see if we are now running bash or ksh.
	if [ -z "$RANDOM" ]; then
		# If the 'which' output contains a space, then it is probably an error.
		if [ -n "`which bash 2>/dev/null | grep -v ' '`" ]; then
			exec bash $0 $*
		elif [ -n "`which ksh 2>/dev/null | grep -v ' '`" ]; then
			exec ksh $0 $*
		else
			echo "Unable to find the bash or ksh shell to run rkhunter."
			exit 1
		fi

		exit 0
	fi
fi


#
# Check to see if we are using the '--debug' option. If so, then
# we exec to log everything to the debug file.
#

if [ -n "`echo \"$*\" | grep '\-\-debug'`" ]; then
	RKHDEBUGFILE=""
	RKHDEBUGBASE="/tmp/rkhunter-debug"

	#
	# Ensure we create a random file name.
	#

	if [ -n "`which mktemp 2>/dev/null | grep -v ' '`" ]; then
		RKHDEBUGFILE=`mktemp ${RKHDEBUGBASE}.XXXXXXXXXX`
	elif [ -n "$RANDOM" ]; then
		RKHDEBUGFILE="${RKHDEBUGBASE}.$RANDOM"
	elif [ -n "`date +%N%s 2>/dev/null | grep '^[0-9][0-9]*$'`" ]; then
		RKHDEBUGFILE="${RKHDEBUGBASE}.`date +%N%s%N`"
	elif [ -n "`date +%Y%m%d%H%M%S 2>/dev/null | grep '^[0-9][0-9]*$'`" ]; then
		RKHDEBUGFILE="${RKHDEBUGBASE}.`date +%Y%m%d%H%M%S`"
	else
		RKHDEBUGFILE="${RKHDEBUGBASE}.$$"
	fi

	if [ -e "${RKHDEBUGFILE}" ]; then
		if [ -f "${RKHDEBUGFILE}" -a ! -h "${RKHDEBUGFILE}" ]; then
			rm -f "${RKHDEBUGFILE}" >/dev/null 2>&1
		else
			echo "Cannot use '--debug' option. Debug file \"${RKHDEBUGFILE}\" already exists, but it is not a file."
			exit 1
		fi
	fi

	DEBUG_OPT=1

	exec 1>"${RKHDEBUGFILE}" 2>&1
	chmod 600 "${RKHDEBUGFILE}" >/dev/null 2>&1
	set -x
else
	DEBUG_OPT=0
fi


#
# Now we must determine if we are using the Korn shell or not. If so,
# then we alias the 'echo' command and set ECHOOPT. For other shells,
# we try and determine the real shell being used, and test to see if
# the 'echo -e' command is valid or not. We set ECHOOPT accordingly.
#

#
# Unfortunately *BSD doesn't seem to allow capturing of unknown commands.
# So we must alias 'print' to something valid, but which will fail.
#

test $BSDOS -eq 1 && alias print=false

if [ "`print "rkh-ksh-string-test" 2>/dev/null`" = "rkh-ksh-string-test" ]; then
	alias echo='print'
	ECHOOPT="--"
	MYSHELL=ksh
elif [ $SUNOS -eq 1 ]; then
	# For Solaris, if we are not running ksh, then it must be bash.
	MYSHELL=bash
	ECHOOPT="-e"
else
	#
	# We want to get the actual shell used by this program, and
	# so we need to test /bin/sh.
	#

	MYSHELL=/bin/sh
	test -h ${MYSHELL} && MYSHELL=`readlink ${MYSHELL} 2>/dev/null`
	MYSHELL=`basename ${MYSHELL} 2>/dev/nu