2007-10-26 22:44:33 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
#Stunnel init for xcat:
|
|
|
|
XCATDEST=""
|
2007-10-31 03:42:29 +00:00
|
|
|
killall stunnel
|
2007-10-26 22:44:33 +00:00
|
|
|
for parm in `cat /proc/cmdline`; do
|
|
|
|
key=`echo $parm|awk -F= '{print $1}'`
|
|
|
|
if [ "$key" == "xcatd" ]; then
|
|
|
|
XCATDEST=`echo $parm|awk -F= '{print $2}'`
|
2007-10-31 03:42:29 +00:00
|
|
|
XCATPORT=`echo $XCATDEST|awk -F: '{print $2}'`
|
2007-10-26 22:44:33 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
mkdir -p /etc/stunnel
|
|
|
|
echo 'client=yes' > /etc/stunnel/stunnel.conf
|
|
|
|
echo 'foreground=yes' >> /etc/stunnel/stunnel.conf
|
|
|
|
echo 'verify=0' >> /etc/stunnel/stunnel.conf
|
|
|
|
echo '[xcatds]' >> /etc/stunnel/stunnel.conf
|
|
|
|
echo 'accept=301' >> /etc/stunnel/stunnel.conf
|
|
|
|
echo 'connect='$XCATDEST >> /etc/stunnel/stunnel.conf
|
2007-10-31 03:42:29 +00:00
|
|
|
if [ -r /tmp/dhcpserver ]; then
|
|
|
|
echo '[dhcps]' >> /etc/stunnel/stunnel.conf
|
|
|
|
echo 'accept=300' >> /etc/stunnel/stunnel.conf
|
|
|
|
echo 'connect='`cat /tmp/dhcpserver`':'$XCATPORT >> /etc/stunnel/stunnel.conf
|
|
|
|
fi
|
2007-10-26 22:44:33 +00:00
|
|
|
mkdir -p /usr/var/run/stunnel
|
|
|
|
stunnel &
|