[-]
[+]
|
Changed |
blocksshd.spec
|
|
[-]
[+]
|
Changed |
blocksshd-suse.init
^
|
@@ -20,8 +20,11 @@
test -x $BLOCKSSHD_BIN || { echo "$BLOCKSSHD_BIN not installed";
if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; }
-# Read config
-. $BLOCKSSHD_CONFIG
+BLOCKSSHD_SYSCONFIG=/etc/sysconfig/blocksshd
+test -e $BLOCKSSHD_SYSCONFIG || { echo "BLOCKSSHD_SYSCONFIG not installed";
+ if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; }
+
+. $BLOCKSSHD_SYSCONFIG
. /etc/rc.status
rc_reset
@@ -29,12 +32,14 @@
case "$1" in
start)
echo -n "Starting blocksshd daemon"
- startproc $BLOCKSSHD_BIN --start
+ startproc $BLOCKSSHD_BIN --start
+ $STARTCMD
rc_status -v
;;
stop)
echo -n "Shutting down blocksshd daemon"
- $BLOCKSSHD_BIN --stop
+ killproc -TERM $BLOCKSSHD_BIN
+ $STOPCMD
rc_status -v
;;
try-restart)
|
[-]
[+]
|
Added |
blocksshd.sysconfig
^
|
@@ -0,0 +1,12 @@
+# blocksshd startup & stop configuration
+
+# startup
+# e.g. iptables -A INPUT -j blocksshd
+# STARTCMD="sleep 1 ; /usr/sbin/iptables -A INPUT -j `grep chain /etc/blocksshd.conf | awk -F\' '{print $2}'`"
+
+STARTCMD=""
+# stop
+# set all chains to accept, flush chains , remove extra chains
+# STOPCMD="/usr/sbin/iptables -P INPUT ACCEPT ; /usr/sbin/iptables -P FORWARD ACCEPT ; /usr/sbin/iptables -P OUTPUT ACCEPT ; /usr/sbin/iptables -F ; /usr/sbin/iptables -X"
+
+STOPCMD=""
|