packages/imspector: use new service functions, change 'enable' option to 'enabled'
git-svn-id: svn://svn.openwrt.org/openwrt/packages@29089 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
c8b82c097f
commit
6eb76e31ba
@ -1,16 +1,17 @@
|
|||||||
# Copyright (C) 2007-2009 OpenWrt.org
|
#
|
||||||
|
# Copyright (C) 2007-2011 OpenWrt.org
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
# Author: Carlos Cesario
|
# Author: Carlos Cesario
|
||||||
|
#
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=imspector
|
PKG_NAME:=imspector
|
||||||
PKG_VERSION:=0.9
|
PKG_VERSION:=0.9
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=http://www.imspector.org/downloads
|
PKG_SOURCE_URL:=http://www.imspector.org/downloads
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
config imspector
|
config imspector
|
||||||
# Enable the proxy
|
# Enable the proxy
|
||||||
option enable 1
|
option enabled 1
|
||||||
|
|
||||||
# The listening ip address for redirected connections
|
# The listening ip address for redirected connections
|
||||||
option listenaddr 0.0.0.0
|
option listenaddr 0.0.0.0
|
||||||
|
@ -1,41 +1,30 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
# Copyright (C) 2008 OpenWrt.org
|
# Copyright (C) 2008-2011 OpenWrt.org
|
||||||
|
|
||||||
START=50
|
START=50
|
||||||
|
|
||||||
DAEMON=/usr/sbin/imspector
|
CFGFILE=/var/etc/imspector.conf
|
||||||
CFG_D=/var/etc
|
|
||||||
CFGFILE=$CFG_D/imspector.conf
|
|
||||||
LOG_D=/var/log/imspector
|
|
||||||
|
|
||||||
start() {
|
atom() {
|
||||||
[ -d $CFG_D ] || mkdir -p $CFG_D
|
local section="$1"
|
||||||
[ -d $LOG_D ] || mkdir -p $LOG_D
|
local option="$2"
|
||||||
|
|
||||||
config_load imspector
|
config_get _value "$section" "$option"
|
||||||
config_foreach start_imspector imspector
|
[ -n "$_value" ] && echo "$option=${_value}"
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
start_instance() {
|
||||||
start-stop-daemon -q -x "$DAEMON" -K
|
local section="$1"
|
||||||
rm -f $CFGFILE
|
|
||||||
}
|
|
||||||
|
|
||||||
restart() {
|
config_get_bool enabled "$section" enabled '0'
|
||||||
stop
|
[ $enabled -gt 0 ] || return 1
|
||||||
sleep 2
|
|
||||||
start
|
|
||||||
}
|
|
||||||
|
|
||||||
start_imspector() {
|
|
||||||
config_get_bool enable "$1" enable
|
|
||||||
[ "$enable" -eq "1" ] || return 0
|
|
||||||
|
|
||||||
echo '### AUTOGENERATED CONFIGURATION' > $CFGFILE
|
echo '### AUTOGENERATED CONFIGURATION' > $CFGFILE
|
||||||
echo '### DO NOT EDIT' >> $CFGFILE
|
echo '### DO NOT EDIT' >> $CFGFILE
|
||||||
echo '### SEE /etc/config/imspector INSTEAD' >> $CFGFILE
|
echo '### SEE /etc/config/imspector INSTEAD' >> $CFGFILE
|
||||||
echo '' >> $CFGFILE
|
echo '' >> $CFGFILE
|
||||||
|
|
||||||
imspector_options='listenaddr port http_port pidfilename plugin_dir
|
options='listenaddr port http_port pidfilename plugin_dir
|
||||||
user group ssl ssl_key ssl_cert ssl_ca_key ssl_ca_cert
|
user group ssl ssl_key ssl_cert ssl_ca_key ssl_ca_cert
|
||||||
ssl_cert_dir ssl_verify_dir ssl_verify response_prefix
|
ssl_cert_dir ssl_verify_dir ssl_verify response_prefix
|
||||||
response_postfix responder_filename notice_days notice_response
|
response_postfix responder_filename notice_days notice_response
|
||||||
@ -47,19 +36,21 @@ start_imspector() {
|
|||||||
badwords_block_count acl_filename db_filter_filename
|
badwords_block_count acl_filename db_filter_filename
|
||||||
block_files block_webcams censord'
|
block_files block_webcams censord'
|
||||||
|
|
||||||
for option in $imspector_options; do
|
for option in $options; do
|
||||||
imspector_atom "$1" "$option" '"' >> $CFGFILE
|
atom "$section" "$option" '"' >> $CFGFILE
|
||||||
done
|
done
|
||||||
|
|
||||||
start-stop-daemon -S -q -x "$DAEMON" -- -c "$CFGFILE"
|
service_start /usr/sbin/imspector -c "$CFGFILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
imspector_atom() {
|
start() {
|
||||||
local SECTION=$1
|
mkdir -m 0755 -p /var/etc
|
||||||
local OPTION=$2
|
mkdir -m 0755 -p /var/log/imspector
|
||||||
|
|
||||||
config_get _value "$SECTION" "$OPTION"
|
config_load 'imspector'
|
||||||
[ -n "$_value" -o "$EMPTY_DISABLED" -eq "1" ] && {
|
config_foreach start_instance 'imspector'
|
||||||
echo "$OPTION=${_value}"
|
}
|
||||||
}
|
|
||||||
|
stop() {
|
||||||
|
service_stop /usr/sbin/imspector
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user