| 1 | #!/bin/bash |
|---|
| 2 | #Version 0.20 |
|---|
| 3 | #Written by Amil Khanzada (http://AmilKhanzada.com/) |
|---|
| 4 | #This script is released as is. Use at your own risk. |
|---|
| 5 | #Released to public domain |
|---|
| 6 | #See https://wush.net/trac/rangepublic/wiki/StartupScripts |
|---|
| 7 | |
|---|
| 8 | echo Runs OpenBTS, FreeSWITCH, smqueue, sipauthserve, and finally OpenBTSCLI |
|---|
| 9 | echo Make sure that the OBTS_ROOT and FS_ROOT variables in this script are set correctly and that your radio is attached via USB! |
|---|
| 10 | |
|---|
| 11 | #get sudo privileges |
|---|
| 12 | sudo echo |
|---|
| 13 | |
|---|
| 14 | #store FreeSWITCH and OpenBTS root locations |
|---|
| 15 | OBTS_ROOT="/usr/local/src/openbts" |
|---|
| 16 | FS_ROOT="/usr/local/freeswitch" |
|---|
| 17 | |
|---|
| 18 | #start FreeSWITCH |
|---|
| 19 | cd $FS_ROOT/bin |
|---|
| 20 | sudo killall freeswitch &> /tmp/tmp |
|---|
| 21 | ulimit -s 240 |
|---|
| 22 | sleep 2s |
|---|
| 23 | sudo gnome-terminal -x sh -c "sudo ./freeswitch" & |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | #start smqueue and sipauthserve |
|---|
| 27 | cd $OBTS_ROOT |
|---|
| 28 | sudo gnome-terminal --tab -e "sudo smqueue/trunk/smqueue/smqueue" --tab -e "sudo subscriberRegistry/trunk/sipauthserve" & |
|---|
| 29 | |
|---|
| 30 | #start OpenBTS |
|---|
| 31 | cd $OBTS_ROOT/openbts/trunk/apps |
|---|
| 32 | sudo killall transceiver &> /tmp/tmp #sometimes necessary |
|---|
| 33 | sudo gnome-terminal -x sh -c "sudo ./OpenBTS" & |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | #finally, start the CLI |
|---|
| 37 | echo ---All other processes initialized. Please wait a few seconds for FreeSWITCH to initialize--- |
|---|
| 38 | echo |
|---|
| 39 | sudo ./OpenBTSCLI |
|---|
| 40 | |
|---|