Browse Source

retab

master
Charles Reid 1 year ago
parent
commit
1d70d1f5f9
3 changed files with 27 additions and 27 deletions
  1. +8
    -8
      build_mongodb.sh
  2. +9
    -9
      close_fw.sh
  3. +10
    -10
      open_fw.sh

+ 8
- 8
build_mongodb.sh View File

@@ -13,19 +13,19 @@
# https://charlesreid1.com/wiki/Docker/Dockerfiles

function usage {
echo ""
echo "build_mongodb.sh script:"
echo "builds a MongoDB docker container."
echo ""
echo " ./build_mongodb.sh"
echo ""
echo ""
echo "build_mongodb.sh script:"
echo "builds a MongoDB docker container."
echo ""
echo " ./build_mongodb.sh"
echo ""
}

if [[ "$#" -ne 0 ]];
then
usage
usage
else

docker build -t jupitermongo .
docker build -t jupitermongo .

fi

+ 9
- 9
close_fw.sh View File

@@ -5,22 +5,22 @@
# or the server that runs the docker stunnel container.

function usage {
echo ""
echo "close_fw.sh script:"
echo "opens the firewall to a particular port using iptables."
echo "specify a port number for the firewall to open:"
echo ""
echo " ./close_fw.sh 666"
echo ""
echo ""
echo "close_fw.sh script:"
echo "opens the firewall to a particular port using iptables."
echo "specify a port number for the firewall to open:"
echo ""
echo " ./close_fw.sh 666"
echo ""
}


if [[ "$#" -ne 1 || $1 =~ "[0-9]\{1,5\}" ]];
then
usage
usage
else

iptables -A INPUT -p tcp --dport ${1} -j DROP
iptables -A INPUT -p tcp --dport ${1} -j DROP

fi


+ 10
- 10
open_fw.sh View File

@@ -5,23 +5,23 @@
# or the server that runs the docker stunnel container.

function usage {
echo ""
echo "open_fw.sh script:"
echo "opens the firewall to a particular port using iptables."
echo "specify a port number for the firewall to open:"
echo ""
echo " ./open_fw.sh 666"
echo ""
echo ""
echo "open_fw.sh script:"
echo "opens the firewall to a particular port using iptables."
echo "specify a port number for the firewall to open:"
echo ""
echo " ./open_fw.sh 666"
echo ""
}


if [[ "$#" -ne 1 || $1 =~ "[0-9]\{1,5\}" ]];
then
usage
usage
else

iptables -A INPUT -p tcp --dport ${1} -j ACCEPT
iptables -A FORWARD -p tcp -j ACCEPT --dport ${1} -m state --state NEW
iptables -A INPUT -p tcp --dport ${1} -j ACCEPT
iptables -A FORWARD -p tcp -j ACCEPT --dport ${1} -m state --state NEW

fi


Loading…
Cancel
Save