pid-owner.txt

pid-owner.txt - v i а SеrgеniuS, 05/01/2011 06:10 am

Download (980 Bytes)

 
1
#!/bin/bash
2
#
3
# pid-owner.txt - Example rule on how the pid-owner match could be used.
4
#
5
# Copyright (C) 2001  Oskar Andreasson <bluefluxATkoffeinDOTnet>
6
#
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; version 2 of the License.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program or from the site that you downloaded it
18
# from; if not, write to the Free Software Foundation, Inc., 59 Temple
19
# Place, Suite 330, Boston, MA  02111-1307   USA
20
#
21
22
PID=`ps aux |grep inetd |head -n 1 |cut -b 10-14`
23
24
iptables -A OUTPUT -p TCP -m owner --pid-owner $PID -j ACCEPT
25
26
Thank you!