From 22a8346c33f8647a8de42addbb453ca25dde936e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 8 May 2013 12:10:25 -0400 Subject: [PATCH] added addtables script --- ChangeLog | 2 ++ shell/addtables.sh | 8 ++++++++ shell/c9kill.sh | 23 ++++++++++++----------- shell/ssl.sh | 5 +++-- 4 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 shell/addtables.sh diff --git a/ChangeLog b/ChangeLog index 142e433c..0228abfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ dispatch * Moved loading functions to Loader object in DOM module. +* Added addtables script' + 2012.04.22, v0.2.0 diff --git a/shell/addtables.sh b/shell/addtables.sh new file mode 100644 index 00000000..f38def48 --- /dev/null +++ b/shell/addtables.sh @@ -0,0 +1,8 @@ +#!/bin/sh +su iptables -t nat -L # look rules before +su iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000 +su iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 4430 +su iptables -t nat -L # look reles after + +#su iptables -t nat -D PREROUTING 1 +#su iptables -t nat -D PREROUTING 2 \ No newline at end of file diff --git a/shell/c9kill.sh b/shell/c9kill.sh index 40e87d7e..44ced9bf 100755 --- a/shell/c9kill.sh +++ b/shell/c9kill.sh @@ -1,12 +1,13 @@ -kill -9 `ps ax|grep node-openshift|grep -v grep|awk '{print $1}'` -# print finded process -ProcessList=`ps ax|grep node-openshift` -echo $ProcessList -# getting pid of process -PID=`echo "${ProcessList}"|grep -v grep|awk '{print $1}'` -echo $PID -#kill it -if test ! $PID -then echo 'process not found' -else kill -9 $PID && echo 'killed process' +#!/bin/sh +kill -9 `ps ax|grep node-openshift|grep -v grep|awk '{print $1}'` +# print finded process +ProcessList=`ps ax|grep node-openshift` +echo $ProcessList +# getting pid of process +PID=`echo "${ProcessList}"|grep -v grep|awk '{print $1}'` +echo $PID +#kill it +if test ! $PID +then echo 'process not found' +else kill -9 $PID && echo 'killed process' fi \ No newline at end of file diff --git a/shell/ssl.sh b/shell/ssl.sh index e703ad7d..3f02e9e8 100644 --- a/shell/ssl.sh +++ b/shell/ssl.sh @@ -1,3 +1,4 @@ -openssl genrsa -out privatekey.pem 1024 -openssl req -new -key privatekey.pem -out certrequest.csr +#!/bin/sh +openssl genrsa -out privatekey.pem 1024 +openssl req -new -key privatekey.pem -out certrequest.csr openssl x509 -req -in certrequest.csr -signkey privatekey.pem -out certificate.pem \ No newline at end of file