Notifier is now a member
[gregoa/zavai.git] / hooks / gsm
index eba60c6ff9e67b91414d2c190ee56e75dab1435a..849ad4cd3a036792b0b73dff724adab1bdcd5cb0 100755 (executable)
--- a/hooks/gsm
+++ b/hooks/gsm
@@ -1,17 +1,39 @@
 #!/bin/sh
 
+make_default_conf() {
+       cat > ~/.frameworkd.conf << EOT
+[frameworkd]
+log_to=file
+log_destination=/tmp/frameworkd.log
+
+[ogsmd]
+log_level=INFO
+modemtype = ti_calypso
+ti_calypso_deep_sleep = adaptive
+ti_calypso_dsp_mode = aec+nr
+ti_calypso_muxer = fso-abyss
+EOT
+}
+
 case "$1" in
        # At the start of zavai
        status)
        ;;
+       pre)
+               exec om gsm power 1
+       ;;
+       post)
+               exec om gsm power 0
+       ;;
        # Run, blocking until the process ends
        run)
                if [ -x /usr/bin/frameworkd ]
                then
+                       # Make default config if missing
+                       test -e ~/.frameworkd.conf || make_default_conf
+
                        # Start frameworkd for GSM services only
-                       om gsm power 1
-                       /usr/bin/frameworkd -s ogsmd > /tmp/zavai-frameworkd.log 2>&1
-                       om gsm power 0
+                       exec /usr/bin/frameworkd -s ogsmd > /tmp/zavai-frameworkd.log 2>&1
                else
                        # For testing
                        exec sleep 10