- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
#!/bin/bash
CODE='timezone.txt'
WDIR="dl-${CODE}"
TGTDIR="/etc/puppet/modules/nginx/files/etc/nginx/maxmind/"
URL='http://www.maxmind.com/timezone.txt'
mkdir "${WDIR}"
cd "${WDIR}"
wget ${URL} -O "${CODE}"
find -name "${CODE}" | while read F
do
chown root:root -vf "${F}"
chmod -vf 644 "${F}"
mv -vf "${F}" "${TGTDIR}"
TMPDIR=`dirname "${F}"`
if [[ ${TMPDIR} == '.' || ${TMPDIR} == '..' || ${TMPDIR} == '/' ]]
then
# root's rm -rf safety
continue
fi
echo rm -rfv "${TMPDIR}"
rm -rfv "${TMPDIR}"
done