2
0

.bashrc 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. #
  2. # FreeSWITCH Dev .bashrc
  3. #
  4. export UNAME=`uname -s`
  5. if [ "`id -u`" = "0" ]; then
  6. if [ "${UNAME}" = "Linux" ]; then
  7. if [ -d /usr/lib/ccache ]; then
  8. export PATH="/usr/lib/ccache:$PATH"
  9. fi
  10. export PATH="$PATH:/opt/bin:/usr/local/bin:/usr/local/sbin:/usr/local/freeswitch/bin"
  11. if [ -d /usr/src/freeswitch.git/support-d/utils ]; then
  12. export PATH="/usr/src/freeswitch.git/support-d/utils:$PATH"
  13. fi
  14. export PCVAR=`find /usr -name freeswitch.pc | grep -v build/freeswitch.pc | sed -e ':a' -e 'N' -e 's/\n/:/g'`
  15. if [ -n "$PCVAR" ]; then
  16. export PCDIR=${PCVAR%/*}
  17. export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$PCDIR:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig
  18. export localstatedir=`pkg-config freeswitch --variable=localstatedir`
  19. export sysconfdir=`pkg-config freeswitch --variable=sysconfdir`
  20. export logfiledir=`pkg-config freeswitch --variable=logfiledir`
  21. export grammardir=`pkg-config freeswitch --variable=grammardir`
  22. export runtimedir=`pkg-config freeswitch --variable=runtimedir`
  23. export libexecdir=`pkg-config freeswitch --variable=libexecdir`
  24. export exec_prefix=`pkg-config freeswitch --variable=exec_prefix`
  25. export modulesdir=`pkg-config freeswitch --variable=modulesdir`
  26. export bindir=`pkg-config freeswitch --variable=bindir`
  27. export dbdir=`pkg-config freeswitch --variable=dbdir`
  28. export recordingsdir=`pkg-config freeswitch --variable=recordingsdir`
  29. export prefix=`pkg-config freeswitch --variable=prefix`
  30. export libdir=`pkg-config freeswitch --variable=libdir`
  31. export scriptdir=`pkg-config freeswitch --variable=scriptdir`
  32. export includedir=`pkg-config freeswitch --variable=includedir`
  33. export htdocsdir=`pkg-config freeswitch --variable=htdocsdir`
  34. export soundsdir=`pkg-config freeswitch --variable=soundsdir`
  35. else
  36. export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig
  37. fi
  38. fi
  39. if [ "${UNAME}" = "SunOS" ]; then
  40. export PATH="$PATH:/opt/64/bin:/opt/bin:/usr/local/bin:/usr/local/sbin:/usr/local/freeswitch/bin"
  41. export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/64/lib/pkgconfig:/usr/lib/amd64/pkgconfig:/opt/lib/pkgconfig:/usr/lib/pkgconfig
  42. fi
  43. if [ "${UNAME}" = "OpenBSD" ]; then
  44. export PATH="$PATH:/usr/local/freeswitch/bin"
  45. export AUTOCONF_VERSION=2.69
  46. export AUTOMAKE_VERSION=1.13
  47. export LIBTOOL=/usr/local/bin/libtoolize
  48. export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
  49. export PKG_PATH=http://openbsd.mirrors.pair.com/`uname -r`/packages/`machine -a`/
  50. fi
  51. if [ "${UNAME}" = "NetBSD" ]; then
  52. export PATH="$PATH:/usr/local/freeswitch/bin"
  53. export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/usr/pkg/lib/pkgconfig
  54. export PKG_PATH=http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/`uname -m`/`uname -r`/All/
  55. fi
  56. if [ "${UNAME}" = "FreeBSD" ]; then
  57. export PATH="$PATH:/usr/local/freeswitch/bin"
  58. export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/usr/pkg/lib/pkgconfig
  59. fi
  60. if [ "${UNAME}" = "DragonFly" ]; then
  61. export PATH="$PATH:/usr/local/freeswitch/bin"
  62. export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/usr/pkg/lib/pkgconfig
  63. fi
  64. fi
  65. if [ "${UNAME}" = "Darwin" ]; then
  66. if [ -d ~/src/depot_tools ]; then
  67. export PATH=$PATH:~/src/depot_tools
  68. fi
  69. if [ -d "/Applications/Chromium.app" ]; then
  70. alias chromium='CHROME_LOG_FILE=chrome.log /Applications/Chromium.app/Contents/MacOS/Chromium --args --enable-usermedia-screen-capturing --usermedia-screen-capturing --enable-logging --v=1 --vmodule=*source*/talk/*=5 2>&1 | tee console.log'
  71. fi
  72. if [ -d "/Applications/Google Chrome Canary.app" ]; then
  73. alias canary='CHROME_LOG_FILE=chrome.log /Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --args --enable-usermedia-screen-capturing --usermedia-screen-capturing --enable-logging --v=1 --vmodule=*source*/talk/*=5 2>&1 | tee console.log'
  74. fi
  75. if [ -d "/Applications/Google Chrome.app" ]; then
  76. alias chrome='CHROME_LOG_FILE=chrome.log /Applications/Google\ Chrome.app/Concd outtents/MacOS/Google\ Chrome --args --enable-usermedia-screen-capturing --usermedia-screen-capturing --enable-logging --v=1 --vmodule=*source*/talk/*=5 2>&1 | tee console.log'
  77. fi
  78. fi
  79. if [ ! -f ~/.inputrc ]; then
  80. export INPUTRC="/etc/inputrc"
  81. fi
  82. set -o emacs
  83. # BE GONE SATAN!
  84. #export PROMPT_COMMAND="history -a; history -c; history -r; ${PROMPT_COMMAND}"
  85. export HISTSIZE=5000
  86. export TERM=xterm-256color
  87. export LESSCHARSET="latin1"
  88. export LESS="-R"
  89. export CHARSET="ISO-8859-1"
  90. export PS1='\n\[\033[01;31m\]\u@\h\[\033[01;36m\] [\d \@] \[\033[01;33m\] \w\n\[\033[00m\]<\#>:'
  91. export PS2="\[\033[1m\]> \[\033[0m\]"
  92. if [ -f ~/.viplease ]; then
  93. if [ -f /usr/bin/vim ]; then
  94. export VISUAL=vim
  95. else
  96. export VISUAL=vi
  97. fi
  98. else
  99. export VISUAL=emacs
  100. fi
  101. export GIT_SSL_NO_VERIFY=true
  102. umask 022
  103. alias e='emacs'
  104. alias eamcs='emacs'
  105. alias emcas='emacs'
  106. alias meacs='emacs'
  107. alias mecas='emacs'
  108. alias bgit='git commit --author "Brian West <brian@freeswitch.org>"'
  109. alias mgit='git commit --author "Mike Jerris <mike@jerris.com>"'
  110. alias tgit='git commit --author "Anthony Minessale <anthm@freeswitch.org>"'
  111. alias dp='emacs $sysconfdir/dialplan/default.xml'
  112. alias go='$bindir/freeswitch -nonat'
  113. alias fstop='top -p `cat $runtimedir/freeswitch.pid`'
  114. alias fsgcore='gcore `cat $runtimedir/freeswitch.pid`'
  115. alias fsgdb='gdb $bindir/freeswitch `cat $runtimedir/freeswitch.pid`'
  116. alias fscore='gdb $bindir/freeswitch `ls -rt core.* | tail -n1`'
  117. alias emacs='emacs -nw'
  118. if [ "${UNAME}" = "Linux" ]; then
  119. alias govg='valgrind --tool=memcheck --log-file=vg.log --leak-check=full --leak-resolution=high --show-reachable=yes .libs/freeswitch -vg'
  120. alias jitteron='tc qdisc add dev eth0 root handle 1: netem delay 40ms 20ms ; tc qdisc add dev eth0 parent 1:1 pfifo limit 1000'
  121. alias jitteroff='tc qdisc del dev eth0 root netem'
  122. fi
  123. # Auto Update the .bashrc if hostname contains freeswitch.org
  124. if [[ $(hostname) =~ "freeswitch.org" ]]; then
  125. if [ -f /usr/src/freeswitch.git/support-d/.bashrc ]; then
  126. /usr/bin/diff --brief <(sort /usr/src/freeswitch.git/support-d/.bashrc) <(sort ~/.bashrc) >/dev/null
  127. if [ $? -eq 1 ]; then
  128. /bin/cp -f /usr/src/freeswitch.git/support-d/.bashrc ~/
  129. echo ".bashrc updated."
  130. source ~/.bashrc
  131. fi
  132. fi
  133. fi
  134. # End Auto Update
  135. # End of file