"Fossies" - the Fresh Open Source Software Archive

Member "coarseknocking-0.0.6/uninstall" (27 Mar 2006, 2697 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: uninstall
    4 # Uninstall 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 Uninstaller ***************"
   44 
   45 confdir="/etc/coarseknocking/"
   46 bindir="/usr/local/bin"
   47 
   48 if [ $UID != "0" ]
   49 then
   50     echo -e "ERROR: User must be root..."
   51     exit 1
   52 fi
   53 
   54 if [ -d $confdir ]
   55 then
   56     echo -e "Removing configuration directory..."
   57     if rm -rf $confdir
   58     then
   59         echo -e "Configuration directory removed..."
   60     else
   61         echo -e "Error removing configuration directory!"
   62         exit 1
   63     fi
   64 else
   65     echo -e "Configuration directory not found..."
   66     echo -e "Maybe program is not installed!"
   67     exit 1
   68 fi
   69 
   70 if [ -f $bindir/coarseknocking ]
   71 then
   72     echo -e "Removing executable file..."
   73     if rm -rf $bindir/coarseknocking*
   74     then
   75         echo -e "Executable file removed..."
   76     else
   77         echo -e "Error removing executable file!"
   78         exit 1
   79     fi
   80 else
   81     echo -e "Executable file not found..."
   82     exit 1
   83 fi
   84 
   85 echo -e "Uninstalation finished!!!"
   86 exit 0
   87 
   88 # End of Code ###