projects
/
openwrt
/
svn-archive
/
archive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d8887b7
)
bring in optional key generation
author
Tim Yardley
<lst@openwrt.org>
Sun, 3 Dec 2006 09:22:28 +0000
(09:22 +0000)
committer
Tim Yardley
<lst@openwrt.org>
Sun, 3 Dec 2006 09:22:28 +0000
(09:22 +0000)
SVN-Revision: 5688
net/stunnel/files/stunnel.init
patch
|
blob
|
history
diff --git
a/net/stunnel/files/stunnel.init
b/net/stunnel/files/stunnel.init
index c26e87dae0b787d0cb5662d7d4d3acad9d2e2274..e4de45b61383a76713ee3e0363fd4b3776a5772e 100755
(executable)
--- a/
net/stunnel/files/stunnel.init
+++ b/
net/stunnel/files/stunnel.init
@@
-2,11
+2,23
@@
case "$1" in
start|boot)
case "$1" in
start|boot)
- # reasons for starting
- [ -e "/etc/stunnel/stunnel.pem" ] && {
- chmod og-rwx /etc/stunnel/stunnel.pem
- stunnel
- }
+ if [ -s "/etc/stunnel/stunnel.pem" ]; then
+ chmod og-rwx /etc/stunnel/stunnel.pem
+ stunnel
+ else
+ [ -e /etc/stunnel/config ] && \
+ . /etc/stunnel/config
+
+ X509_CN=${X509_CN:-"router"}
+ X509_O=${X509_O:-"openwrt.org"}
+ X509_OU=${X509_OU:-"open-source firmware"}
+
+ [ -x /sbin/keygen ] && {
+ (keygen "$X509_CN" "$X509_O" "$X509_OU" > /etc/stunnel/stunnel.pem;
+ chmod og-rwx /etc/stunnel/stunnel.pem;
+ stunnel) &
+ }
+ fi
;;
stop)
killall stunnel
;;
stop)
killall stunnel