25 lines
414 B
Bash
25 lines
414 B
Bash
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
inventory=$1
|
|
|
|
tmp_dir=/tmp/apache-require
|
|
inventory=$tmp_dir/inventory
|
|
to_convert=$tmp_dir/to_convert
|
|
|
|
# Create a backup of the FILE specific for this project
|
|
backup() {
|
|
file=$1
|
|
|
|
cp "$file" "$file".apreq.bak
|
|
}
|
|
|
|
awk '{ print $1 }' "$inventory" > "$to_convert"
|
|
|
|
while IFS= read -r file; do
|
|
echo $file
|
|
backup "$file"
|
|
perl -i ~bwaegeneire/convert.pl "$file"
|
|
done < "$to_convert"
|