Reply To: Spoofing MAC under VMware

Home Page Forums Network Management ZeroShell Spoofing MAC under VMware Reply To: Spoofing MAC under VMware

#46743

imported_fulvio
Participant

root@test root> cat /etc/rc.d/rc3.d/S98rc.local


#!/bin/sh
. /etc/kerbynet.conf
if ! [ -r "$REGISTER/system/startup/EnabledScript" ] ; then
echo yes > "$REGISTER/system/startup/EnabledScript"
fi
$SCRIPTS/runscript postboot

root@test root> cat /root/kerbynet.cgi/scripts/runscript


#!/bin/bash
. /etc/kerbynet.conf
SCRIPTNAME="$1"
OPT="$2"
[ -z "$SCRIPTNAME" ] && exit
DIR=$REGISTER/system/startup/scripts
cd $DIR/$SCRIPTNAME 2>/dev/null || exit
DESCRIPTION="`cat Description 2> /dev/null`"
if [ "$OPT" = test ] ; then
VIEW="cat"
export SCRIPT=/tmp/ScriptToRun$$
tr -d "r" > $SCRIPT
chmod 755 $SCRIPT
else
VIEW="logger -t Scripts"
export SCRIPT=./File
fi

if [ "`cat Enabled 2>/dev/null`" = yes -o "$OPT" = test ] ; then
[ "$OPT" != test ] && echo -n "[$DESCRIPTION]: Running ... " | $VIEW
[ "$OPT" != test ] && echo -n "Script [$DESCRIPTION]: Running ... "
[ "$OPT" = test ] && echo
( $SCRIPT 2>&1 ; echo $? >/tmp/StartupScriptError$$ ) | $VIEW
if [ "`cat /tmp/StartupScriptError$$`" = 0 ] ; then
RESULT=SUCCESS
else
RESULT="ERROR (`cat /tmp/StartupScriptError$$`)"
fi
rm -f /tmp/StartupScriptError$$
[ "$OPT" = test ] && rm -f $SCRIPT
[ "$OPT" != test ] && echo $RESULT
[ "$OPT" = test ] && echo
echo "[$DESCRIPTION]: $RESULT" | $VIEW
else
echo "[$DESCRIPTION]: Disabled" | $VIEW
fi