Репозиторий Sisyphus
Последнее обновление: 8 февраля 2023 | Пакетов: 18184 | Посещений: 26683089
en ru br
Репозитории ALT
S:0.4-alt1
5.1: 0.3-alt0.M51.1
www.altlinux.org/Changes

Группа :: Система/Настройка/Прочее
Пакет: installer-feature-snort-stage3

 Главная   Изменения   Спек   Патчи   Исходники   Загрузить   Gear   Bugs and FR  Repocop 

pax_global_header00006660000000000000000000000064115044223220014505gustar00rootroot0000000000000052 comment=cf136b67b14aaca6a6429cdd6dbcc62814149bdf
installer-feature-snort-stage3-0.3/000075500000000000000000000000001150442232200173225ustar00rootroot00000000000000installer-feature-snort-stage3-0.3/.gear/000075500000000000000000000000001150442232200203165ustar00rootroot00000000000000installer-feature-snort-stage3-0.3/.gear/rules000064400000000000000000000000061150442232200213670ustar00rootroot00000000000000tar: .installer-feature-snort-stage3-0.3/50-snort.sh000075500000000000000000000026171150442232200212560ustar00rootroot00000000000000#!/bin/sh -efu

a= . install2-init-functions
. alterator-net-functions

CHKCONFIG=/sbin/chkconfig
SNORT_CONF="$destdir/etc/snort/snort.conf"
RULESDIR="$destdir/etc/snort/rules"
RESET_DB=/usr/lib/alterator-snort/reset-snort-db.sh
SYSCONFIG_FILE="$destdir/etc/sysconfig/snort"
ANE_HOOKSDIR="$destdir/usr/lib/alterator/hooks/net-eth.d"

# Remove commented rules files from snort.conf
sed -i '\;^#[[:blank:]]*include[[:blank:]]\$RULE_PATH/.\+\.rules$;d' "$SNORT_CONF"

# Remove empty rules files from snort.conf
for rule in $(sed -n 's;^[[:blank:]]*include[[:blank:]]\$RULE_PATH/\(.\+\)\.rules$;\1;p' "$SNORT_CONF"); do
if ! grep -qs '^[^#]' "$RULESDIR/$rule.rules"; then
sed -i "\;^[[:blank:]]*include[[:blank:]]\$RULE_PATH/$rule\.rules$;d" "$SNORT_CONF"
fi
done

# Enable snort only for bridges if they exists
ifaces=
for i in $(list_iface); do
ifaces="$ifaces${ifaces:+ }$i"
done
[ -n "$ifaces" ] && sed -i "s/^INTERFACES=any/INTERFACES=\"$ifaces\"/" "$SYSCONFIG_FILE"

# Create snort database, etc
exec_chroot "$RESET_DB" >/dev/null 2>&1

# Create hook for alterator-net-eth
mkdir -p "$ANE_HOOKSDIR"
cat > "$ANE_HOOKSDIR/50-snort" <<EOF
#!/bin/sh -eu

chkconfig snortd 2>/dev/null && \
! service snortd status >/dev/null 2>&1 && \
service snortd start >/dev/null 2>&1 ||:
EOF
chmod +x "$ANE_HOOKSDIR/50-snort"

# Enable services
exec_chroot $CHKCONFIG mysqld on ||:
exec_chroot $CHKCONFIG snortd on ||:
installer-feature-snort-stage3-0.3/installer-feature-snort-stage3.spec000064400000000000000000000020461150442232200261550ustar00rootroot00000000000000Name: installer-feature-snort-stage3
Version: 0.3
Release: alt1

Summary: Installer stage3 snort hook
License: GPL
Group: System/Configuration/Other
Url: http://www.altlinux.org/Installer/beans
Packager: Mikhail Efremov <sem@altlinux.org>
BuildArch: noarch
Source: %name-%version.tar

Requires: alterator-snort >= 0.1.0

%description
This package contains installer stage3 hook for
alterator-snort module.

%prep
%setup

%install
%define hookdir %_datadir/install2/postinstall.d
mkdir -p %buildroot%hookdir
install -pm755 *.sh %buildroot%hookdir/

%files
%hookdir/*

%changelog
* Wed Dec 22 2010 Mikhail Efremov <sem@altlinux.org> 0.3-alt1
- Create hook for alterator-net-eth.

* Tue Nov 03 2009 Mikhail Efremov <sem@altlinux.org> 0.2-alt3
- fix file path.

* Mon Nov 02 2009 Mikhail Efremov <sem@altlinux.org> 0.2-alt2
- fix 'unbound variable' error.

* Mon Oct 26 2009 Mikhail Efremov <sem@altlinux.org> 0.2-alt1
- enable snort only for bridges if they exists.
- fix exit status.

* Tue Oct 20 2009 Mikhail Efremov <sem@altlinux.org> 0.1-alt1
- Initial build

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin