Add init and config files from #2624
git-svn-id: svn://svn.openwrt.org/openwrt/packages@9475 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
4bda1ecb84
commit
0fb2eccbac
@ -38,6 +38,10 @@ endef
|
||||
define Package/autossh/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/autossh $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/autossh.init $(1)/etc/init.d/autossh
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DATA) ./files/autossh.config $(1)/etc/config/autossh
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,autossh))
|
||||
|
4
net/autossh/files/autossh.config
Normal file
4
net/autossh/files/autossh.config
Normal file
@ -0,0 +1,4 @@
|
||||
config autossh
|
||||
option ssh '-i /etc/dropbear/id_rsa -N -T -R 2222:localhost:22 user@host'
|
||||
option monitorport '20000'
|
||||
option poll '600'
|
26
net/autossh/files/autossh.init
Normal file
26
net/autossh/files/autossh.init
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2007 OpenWrt.org
|
||||
START=80
|
||||
|
||||
start_service () {
|
||||
local section="$1"
|
||||
config_get ssh "$section" ssh
|
||||
config_get monitorport "$section" monitorport
|
||||
config_get poll "$section" poll
|
||||
|
||||
AUTOSSH_POLL=${poll:-"600"} autossh -M ${monitorport:-"20000"} -f ${ssh}
|
||||
}
|
||||
|
||||
start() {
|
||||
config_load "autossh"
|
||||
config_foreach start_service autossh
|
||||
}
|
||||
|
||||
stop() {
|
||||
killall autossh
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user