Add initial get_htaccess
This commit is contained in:
parent
bdda0c6554
commit
d4462bbdee
15
inventory.sh
15
inventory.sh
|
@ -1,9 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# TODO Find .htacces from DocumentRoot
|
# TODO Find .htaccess from DocumentRoot
|
||||||
# TODO find piece of apache conf in /etc
|
# TODO find piece of apache conf in /etc
|
||||||
# TODO Handle /sur/share/scripts/vhost...
|
# TODO Handle /sur/share/scripts/vhost...
|
||||||
# TODO total by host: vhost, htacces, conf, cgi
|
# TODO total by host: vhost, htaccess, conf, cgi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
@ -12,6 +12,9 @@ apache_conf=$apache_dir/apache2.conf
|
||||||
|
|
||||||
tmp_dir=/tmp/apache-require
|
tmp_dir=/tmp/apache-require
|
||||||
confs=$tmp_dir/confs
|
confs=$tmp_dir/confs
|
||||||
|
confs_vhost=$tmp_dir/confs_vhost
|
||||||
|
confs_system=$tmp_dir/confs_system
|
||||||
|
confs_htaccess=$tmp_dir/confs_htaccess
|
||||||
result=$tmp_dir/result
|
result=$tmp_dir/result
|
||||||
mkdir -p "$tmp_dir"
|
mkdir -p "$tmp_dir"
|
||||||
|
|
||||||
|
@ -40,6 +43,14 @@ get_confs() {
|
||||||
cd - 1>/dev/null
|
cd - 1>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_htaccess() {
|
||||||
|
mv -b "$confs_htaccess" "$confs_htaccess".bak || true
|
||||||
|
|
||||||
|
for file in $(cat "$confs"); do
|
||||||
|
awk 'sub("^[[:space:]]*DocumentRoot[[:space:]]*", "") {print $0}' "$file" >> "$confs_htaccess"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
count_directives() {
|
count_directives() {
|
||||||
directives="Allow Order Deny Satisfy"
|
directives="Allow Order Deny Satisfy"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue