Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Julien Kassar
committed
Mar 12, 2016
1 parent
3848c1e
commit ba31668
Showing
3 changed files
with
79 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
# ConfigServer Security & Firewall (CSF) - Docker | ||
|
||
Install: | ||
## Installation | ||
### Requirement | ||
Make sure to use the scripts from `https://github.com/juliengk/csf-pre_post_sh` | ||
|
||
cp csfpost.sh /usr/local/csf/bin/csfpost.sh | ||
### Install | ||
Installation is quite straightforward: | ||
|
||
``` | ||
# cd /usr/local/src | ||
# git clone https://github.com/juliengk/csf-post-docker.git | ||
# cd csf-post-docker | ||
# sh install.sh | ||
``` | ||
|
||
## User Feedback | ||
### Issues | ||
|
||
If you have any problems with or questions about this image, please contact us through a [GitHub](https://github.com/juliengk/csf-post-docker/issues) issue. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/sh | ||
|
||
SCRIPT_NAME="docker.sh" | ||
|
||
CSF_CUSTOM_PATH="/usr/local/include/csf" | ||
CSFPOSTD_PATH="${CSF_CUSTOM_PATH}/post.d" | ||
|
||
|
||
if [ ! -d ${CSF_CUSTOM_PATH} ]; then | ||
echo "** CSF-PRE_POST_SH is not installed **" | ||
echo "Get it from https://github.com/juliengk/csf-pre_post_sh" | ||
|
||
exit 1 | ||
fi | ||
|
||
PREFIX="None" | ||
if [ "$1" == "-p" ] || [ "$1" == "--prefix" ]; then | ||
PREFIX=$2 | ||
|
||
shift 2 | ||
fi | ||
|
||
SCRIPT_NAME_FINAL="${SCRIPT_NAME}" | ||
if [ ${PREFIX} != "None" ]; then | ||
SCRIPT_NAME_FINAL="${PREFIX}_${SCRIPT_NAME}" | ||
fi | ||
|
||
if [ -f ${CSFPOSTD_PATH}/${SCRIPT_NAME_FINAL} ]; then | ||
md5_0=`md5sum docker.sh | awk '{ print $1 }'` | ||
md5_1=`md5sum ${CSFPOSTD_PATH}/${SCRIPT_NAME_FINAL} | awk '{ print $1 }'` | ||
|
||
if [ ${md5_0} == ${md5_1} ]; then | ||
exit 0 | ||
else | ||
ok=0 | ||
while [ ${ok} -eq 0 ]; do | ||
clear | ||
|
||
echo "** Warning! **" | ||
echo "A different version of the script is already present" | ||
echo "Do you want to replace it (y/n)?" | ||
|
||
read answer | ||
|
||
if [ ${answer} == "y" -o ${answer} == "n" ]; then | ||
ok=1 | ||
fi | ||
done | ||
|
||
if [ ${answer} == "n" ]; then | ||
exit 1 | ||
fi | ||
fi | ||
fi | ||
|
||
cp -f ${SCRIPT_NAME} ${CSFPOSTD_PATH}/${SCRIPT_NAME_FINAL} | ||
chown root:root ${CSFPOSTD_PATH}/${SCRIPT_NAME_FINAL} | ||
chmod 700 ${CSFPOSTD_PATH}/${SCRIPT_NAME_FINAL} | ||
|
||
exit 0 |