📄 address_config.sh
字号:
#!/bin/sh
# address_config.sh -v0.2
# Handy script for laptop users that change their
# IP address frequently. This automates the
# process of updating your Snort rules file.
# You might find his litle script can be usefull, enjoy...
# Sten Kalenda Apeldoorn The Netherlands
# ------------------ MODIFY HERE ---------------------------------------
IF0=eth0
MASK="24"
SNORTDIR="/usr/local/bin"
SNORTLIBDIR="$SNORTDIR/snortlib"
SNORTLOGDIR="/var/log/snort"
# ------------------ DO NOT CHANGE BELOW -------------------------------
if [ ! -d "$SNORTLIBDIR" ] ; then
echo Directory $SNORTLIBDIR not found
exit
fi
cd $SNORTLIBDIR
if [ ! -e "$SNORTLOGDIR" ] ; then
mkdir $SNORTLOGDIR
chmod 700 $SNORTLOGDIR
fi
MYIP=`/sbin/ifconfig $IF0|sed -n -e "s/^[ ]*inet addr\:\([0-9.]*\).*$/\1/p"`
CHG=s\/10\.1\.1\.0\\/24/$MYIP\\/$MASK/g
cat snort-lib | sed $CHG > snort-lib_run
$SNORTDIR/snort -D -A fast -c $SNORTLIBDIR/snort-lib_run
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -