 +	echo $ARGS | grep ' CTLSOCK=' >/dev/null 2>&1 ; \
 +	if [ $? -eq 0 ]; then \
 +	  CTLSOCK=`echo $ARGS | sed 's/.* CTLSOCK=//' | sed 's/ .*//'`; \
-+	  cat $CONF_F | grep -v 'ControlListenAddress' > $TMP_F; \
++	  CTLPORT=`echo $CTLSOCK | sed 's/.*://'`; \
++	  cat $CONF_F | grep -v 'ControlListenAddress' | grep -v ControlPort > $TMP_F; \
++	  echo "ControlPort ${CTLPORT}" >> $TMP_F; \
 +	  echo "ControlListenAddress ${CTLSOCK}" >> $TMP_F; \
 +	  mv -f $TMP_F $CONF_F; \
 +	fi;

+if [ "$1" = "start" ]; then
+	[ -f $DEFAULT ] && . $DEFAULT
+	[ -d $HOME_D ] || mkdir -p $HOME_D
+	[ ! -f $CONF_F ] && cp /etc/tor/torrc $CONF_F
+	[ -d $LOG_D ] || mkdir -p $LOG_D
+	chown $RUN_USER:$RUN_GROUP $LOG_D
+	[ -d $DATA_D ] || mkdir -p $DATA_D

+$(eval $(call BuildPackage,tor))
diff -Naur orig-kamikaze/package/tor/files/tor.init mod-torpkg-kamikaze/package/tor/files/tor.init
--- orig-kamikaze/package/tor/files/tor.init	1970-01-01 00:00:00.000000000 +0000
+++ mod-torpkg-kamikaze/package/tor/files/tor.init	2008-10-16 01:08:41.832711721 +0000
@@ -0,0 +1,112 @@
+#!/bin/sh 
+
+BIN=tor
