]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Add a parseFaxInfo to common-functions.sh
authorAidan Van Dyk <aidan@ifax.com>
Sat, 12 Aug 2006 18:08:42 +0000 (18:08 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Sat, 12 Aug 2006 18:08:42 +0000 (18:08 +0000)
util/common-functions.sh.in

index a8e0410ab891fa4f21fb94d2a4dc46da33536246..f55114373f154285630d3b45fde7d79bc71bbdb4 100644 (file)
@@ -147,4 +147,18 @@ parseQfile()
 
 }
 
+parseFaxInfo()
+{
+    # We use the same basic stuff as parseQfile(), but just to straight assignment
+    eval `$INFO -S '' -s '%s=!=!=!=!=!=!=!=!=' $1 | $AWK -F'=!=!=!=!=!=!=!=!=' '
+    function p(varname,val)
+    {
+        gsub(/\\047/, "\047\\\\\047\047", val);
+        gsub(/\n/, "\047\042\\\\n\042\047", val);
+        printf "%s=\\047%s\\047\n",varname,val
+        printf "export %s\n",varname
+    }
+    { p(toupper($1),$2); }
+    '`
+}