When running ./setup-app-layer.sh require the protocol name to
start with a capital letter so it looks somewhat like a proper
name. This will help give better function names.
For example:
./setup-app-layer.sh IRC
./setup-app-layer.sh Irc
will create function names starting with IRC or Irc. But we do
not want function names to start with "irc".
protoname="$1"
-if [ "${protoname}" = "" ]; then
- usage
- exit 1
-fi
+# Make sure the protocol name looks like a proper name (starts with a
+# capital letter).
+case "${protoname}" in
+
+ [[:upper:]]*)
+ # OK.
+ ;;
+
+ "")
+ usage
+ exit 1
+ ;;
+
+ *)
+ echo "error: protocol name must beging with an upper case letter"
+ exit 1
+ ;;
+
+esac
protoname_lower=$(printf ${protoname} | tr '[:upper:]' '[:lower:]')
protoname_upper=$(printf ${protoname} | tr '[:lower:]' '[:upper:]')