[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [https-everywhere/master 1/3] name created rules with capital letters; add support for <target> tag



Author: Seth Schoen <schoen@xxxxxxx>
Date: Wed, 3 Nov 2010 16:53:33 -0700
Subject: name created rules with capital letters; add support for <target> tag
Commit: 9ed0f0db437631ef2576a62809eb6d369cc7a550

---
 pending-rules/make-trivial-rule |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pending-rules/make-trivial-rule b/pending-rules/make-trivial-rule
index bce277c..f37629d 100755
--- a/pending-rules/make-trivial-rule
+++ b/pending-rules/make-trivial-rule
@@ -8,7 +8,8 @@ then
   exit 1
 fi
 
-dest="$1".xml
+capitalized=$(echo "$1" | cut -c 1 | tr a-z A-Z)$(echo "$1" | cut -c 2-)
+dest="$capitalized".xml
 if [ -f "$dest" ]
 then
   echo "error: $dest already exists." >&2
@@ -30,8 +31,10 @@ fi
 escaped=$(echo "$1" | sed 's/\./\\./g' )
 
 cat > "$dest" <<END
-<ruleset name="$1">
-  <rule from="^http://(www\.)?$escaped/" to="https://www.$1/"/>
+<ruleset name="$capitalized">
+  <target host="$1" />
+  <target host="www.$1" />
+  <rule from="^http://(www\.)?$escaped/" to="https://www.$1/"; />
 </ruleset>
 END
 
-- 
1.7.1