Created
July 26, 2012 14:44
-
-
Save pad92/3182457 to your computer and use it in GitHub Desktop.
Expand apache Vhost
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
#!/usr/bin/env sh | |
if [ ! -f "$1" ]; then | |
echo "Usage $0 : filename to paste" | |
exit 1 | |
fi | |
COUNTER=0 | |
while read LINE | |
do | |
echo -ne "$LINE" | grep -E "^<VirtualHost" 1>/dev/null | |
if [ $? -eq 0 ]; then | |
let COUNTER++ | |
echo "$LINE into /tmp/$COUNTER.conf" | |
echo -n > /tmp/$COUNTER.conf | |
fi | |
echo $LINE >> /tmp/$COUNTER.conf | |
done < $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment