summaryrefslogtreecommitdiff
path: root/lib/common
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2013-10-27 15:14:18 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2013-10-27 15:14:18 +0100
commit0d92ff5fd34d79b54c30c38ac41bc600acf7b7c4 (patch)
tree7807b9d017e44bc522a75f40c7a4589d994455f8 /lib/common
parent5821a949035a5e098a2c6b395818f5efa1c66f8e (diff)
downloadappstore-0d92ff5fd34d79b54c30c38ac41bc600acf7b7c4.tar.gz
appstore-0d92ff5fd34d79b54c30c38ac41bc600acf7b7c4.tar.bz2
appstore-0d92ff5fd34d79b54c30c38ac41bc600acf7b7c4.tar.xz
appstore-0d92ff5fd34d79b54c30c38ac41bc600acf7b7c4.zip
o Dropping the CSV file for using a native app config file instead.
o Using apache as an example app. o Adding appstore-add-app as a utility to register appliations.
Diffstat (limited to 'lib/common')
-rwxr-xr-xlib/common14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/common b/lib/common
index 473c8b1..2214480 100755
--- a/lib/common
+++ b/lib/common
@@ -62,3 +62,17 @@ grep_path() {
find `echo $path | tr : " "` -type f -executable 2>/dev/null | (egrep "$regex" || exit 0)
}
+
+assert_valid_app_name() {
+ local app="$1"; shift
+
+ local re="^[a-zA-Z][a-zA-Z0-9]*$"
+ if [[ ! $app =~ $re ]]
+ then
+ fatal "Invalid app name: \"$app\""
+ fi
+}
+
+# Save for later
+usage_app=${0##*/}
+echo_debug=${echo_debug-no}