📄 ntop.init
字号:
#!/bin/sh## chkconfig: 2345 93 83## description: This shell script takes care of starting and stopping ntop.#NOTE: You most likely will have to fix this up to reflect your network.# ntop will not run until:# You have set the admin password - read docs/1STRUN.txt# You have created /etc/ntop.conf with configuration parameters.# Source function library.. /etc/rc.d/init.d/functions# Source networking configuration.. /etc/sysconfig/networkprog="/usr/bin/ntop"name=ntopconf="/etc/${name}.conf"# Check that networking is up.[ ${NETWORKING} = "no" ] && exit 0! [ -x $prog ] && echo $prog not found, aborting && exit 1if ! test -f ${conf}; then echo "ERROR - no configuration file (${conf})" logger -p daemon.err -t ntop no configuration file ${conf} exit 1fidb=`grep '^ *\-P' ${conf} | awk '{ print \$2}'`if test ".${db}" = "."; then db=`grep '^ *--db-file-path' ${conf} | awk '{ print \$2 }'`fiif test ".${db}" = "."; then echo "ERROR - no database parameter in ${conf}" logger -p daemon.err -t no database parameter in ${conf} exit 1fistart () { if ! test -f ${db}/ntop_pw.db; then echo "UNABLE to start ntop - no password set - see docs/1STRUN.txt file" logger -p daemon.err -t ntop unable to start ntop, no password set, see 1STRUN.txt file in docs exit 1 fi x=`grep '\-a' ${conf} | awk '{ print \$2}'` if test ".${x}" = "."; then x=`grep '\-\-access\-log\-path' ${conf} | awk '{ print \$2}'` fi if test ".${x}" != "."; then touch ${x} fi # start daemon echo -n $"Starting $name: " daemon $prog -d @${conf} -L RETVAL=$? echo [ $RETVAL = 0 ] && touch /var/lock/subsys/ntop return $RETVAL}stop () { # stop daemon echo -n $"Stopping $name: " killproc ntop RETVAL=$? echo [ $RETVAL = 0 ] && rm -f /var/lock/subsys/ntop return $RETVAL}restart () { stop start}case "$1" in start) start ;; stop) stop ;; restart) restart ;; condrestart) [ -f /var/lock/subsys/ntop ] && restart || : ;; status) status ntop ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|status}" exit 1esacexit $RETVAL
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -