1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
#!/bin/bash
#
# Sync ModSecurity / libinjection
#
# explode on error
set -e
#
# CLONE LIBINJECTION
#
if [ ! -d libinjection ]; then
git clone https://github.com/client9/libinjection.git
else
(cd libinjection; git pull)
fi
pwd
#
# CLONE MODSECURITY
#
if [ ! -d ModSecurity ]; then
git clone https://github.com/client9/ModSecurity.git
else
( cd ModSecurity; git pull )
fi
pwd
#
# Use right branch
#
(cd ModSecurity; git checkout remotes/trunk )
pwd
#
# COPY IN NEW LIBINJECTION
#
cp libinjection/COPYING.txt ModSecurity/apache2/
cp libinjection/c/libinjection.h ModSecurity/apache2/libinjection
cp libinjection/c/libinjection_sqli.c ModSecurity/apache2/libinjection
cp libinjection/c/libinjection_sqli.h ModSecurity/apache2/libinjection
cp libinjection/c/libinjection_sqli_data.h ModSecurity/apache2/libinjection
#
# REGENERATE / BUILD
#
cd ModSecurity
./autogen.sh
./configure
make
make distclean
#
# ADD NEW BITS
#
git add apache2/libinjection/COPYING.txt
git add apache2/libinjection/libinjection.h
git add apache2/libinjection/libinjection_sqli.h
git add apache2/libinjection/libinjection_sqli.c
git add apache2/libinjection/libinjection_sqli_data.h
# this file seems to get modified, reset just to be safe
git checkout standalone/Makefile.in
git commit -m 'libinjection sync'
#
# PUSH TO SPECIAL BRANCH
#
echo "pushing to remotes/trunk"
git push origin remotes/trunk
#
# PROFIT
#
|