"Fossies" - the Fresh Open Source Software Archive

Member "coarseknocking-0.0.6/install" (27 Mar 2006, 3433 Bytes) of package /linux/privat/old/coarseknocking-0.0.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 ###############################################################################
    3 # File: install
    4 # Install script to Coarse Port Knocking
    5 #
    6 # Copyright (C) 2005  - http://coarseknocking.sourceforge.net
    7 #
    8 # By Andre Luiz Rodrigues Ferreira - si0ux - <andrelrf@gmail.com>
    9 # From Orlandia - SP - Brazil
   10 #
   11 # This is a simple implementation of Port Knocking techniques.
   12 # This sniffs network packets with determined keys and executes commands like
   13 # firewall to open and close ports. In the client mode injects packets with
   14 # key to server.
   15 # This is a personal project of the your author and is available for everybody
   16 # by your GPL Licence.
   17 #
   18 # WARNING: Depends of ngrep (http://ngrep.sourceforge.net) and
   19 #          nemesis (http://nemesis.sourceforge.net) network tools.
   20 #          This software was been tested on Debian GNU/Linux 3.1 system.
   21 #
   22 # More information:
   23 # http://www.portknocking.org
   24 # http://coarseknocking.sourceforge.net
   25 #
   26 ################################################################################
   27 # LICENCE:
   28 # CoarseKnocking is free software; you can redistribute it and/or modify it 
   29 # under the terms of the GNU General Public License as published by the Free
   30 # Software Foundation; either version 2 of the License, or (at your option) any 
   31 # later version.
   32 #
   33 # CoarseKnocking is distributed in the hope that it will be useful, but WITHOUT 
   34 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
   35 # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
   36 #
   37 # You should have received a copy of the GNU General Public License along with 
   38 # CoarseKnocking; if not, write to the Free Software Foundation, Inc., 59 
   39 # Temple Place, Suite 330, Boston, MA  02111-1307  USA
   40 #
   41 ##############################################################################
   42 
   43 echo -e "************* CoarseKnocking Installer ***************"
   44 
   45 confdir="/etc/coarseknocking/"
   46 bindir="/usr/local/bin"
   47 
   48 if [ $UID != "0" ]
   49 then
   50     echo -e "\nERROR: User must be root...\n"
   51     exit 1
   52 fi
   53 
   54 if [ -d $confdir ]
   55 then
   56     echo -e "\nOld configuration directory exists."
   57     echo -e "\nPlease remove!!!"
   58     exit 1
   59 fi
   60 
   61 if [ -f $bindir/coarseknocking ]
   62 then
   63     echo -e "\nOld executable file exists."
   64     echo -e "\nPlease remove!!!"
   65     exit 1
   66 fi
   67 
   68 echo "Creating configuration directory..."
   69 if mkdir $confdir
   70 then
   71     echo -e "Configuration directory created..."
   72 else
   73     echo -e "Error creating configuration directory..."
   74 fi
   75 
   76 echo "Copying configuration files..."
   77 if cp -r ./conf/* $confdir
   78 then
   79     echo -e "Configuration files copied..."
   80 else
   81     echo -e "Error copying configuration files..."
   82     exit 1
   83 fi
   84 
   85 echo -e "Copying executables file..."
   86 if cp -r ./bin/* $bindir
   87 then
   88     echo -e "Executable file copied..."
   89 else
   90     echo -e "Error copying executable file..."
   91     exit 1
   92 fi
   93 
   94 echo -e "Fixing permissions..."
   95 chmod -R 600 $confdir
   96 chmod -R 700 $bindir/coarseknocking
   97 chmod -R 700 $bindir/coarseknockingcfg
   98 
   99 echo -e "************************* WARNING *******************************"
  100 echo -e "This tool depends of the Nemesis (http://nemesis.sourceforge.net)"
  101 echo -e "and ngrep (http://ngrep.sourceforge.net) tools to works!"
  102 echo -e "Please, check if they are installed before run..."
  103 echo -e "*****************************************************************"
  104 
  105 echo -e "Instalation finished!!!"
  106 echo -e "Please check your configuration in $confdir"
  107 echo -e "and run coarseknocking -h to help..."
  108 
  109 exit 0
  110 
  111 # End of Code ###