From 85c3afc080fcb8410e08caea8fb063be73826c29 Mon Sep 17 00:00:00 2001 From: nico Date: Sun, 13 Nov 2011 22:16:12 +0000 Subject: [PATCH] packages/autossh: use new service functions git-svn-id: svn://svn.openwrt.org/openwrt/packages@29072 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/autossh/Makefile | 4 ++-- net/autossh/files/autossh.init | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/net/autossh/Makefile b/net/autossh/Makefile index c02c12d0b..4f3217d25 100644 --- a/net/autossh/Makefile +++ b/net/autossh/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2008 OpenWrt.org +# Copyright (C) 2006-2011 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=autossh PKG_VERSION:=1.4b -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz PKG_SOURCE_URL:=http://www.harding.motd.ca/autossh/ diff --git a/net/autossh/files/autossh.init b/net/autossh/files/autossh.init index d91c7b7ca..b9b1afeaf 100644 --- a/net/autossh/files/autossh.init +++ b/net/autossh/files/autossh.init @@ -1,15 +1,19 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2007 OpenWrt.org +# Copyright (C) 2007-2011 OpenWrt.org + START=80 -start_service () { +start_instance() { local section="$1" - config_get ssh "$section" ssh - config_get gatetime "$section" gatetime - config_get monitorport "$section" monitorport - config_get poll "$section" poll - AUTOSSH_GATETIME=${gatetime:-"30"} AUTOSSH_POLL=${poll:-"600"} autossh -M ${monitorport:-"20000"} -f ${ssh} + config_get ssh "$section" 'ssh' + config_get gatetime "$section" 'gatetime' + config_get monitorport "$section" 'monitorport' + config_get poll "$section" 'poll' + + AUTOSSH_GATETIME="${gatetime:-30}" \ + AUTOSSH_POLL="${poll:-600"}" \ + service_start /usr/sbin/autossh -M ${monitorport:-20000} -f ${ssh} } boot() { @@ -17,10 +21,10 @@ boot() { } start() { - config_load "autossh" - config_foreach start_service autossh + config_load 'autossh' + config_foreach start_instance 'autossh' } stop() { - killall autossh + service_stop /usr/sbin/autossh } -- 2.11.0