.bashrc 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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/Contents/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. if [ -f /usr/src/freeswitch.git/support-d/git-prompt.sh ]; then
  92. . /usr/src/freeswitch.git/support-d/git-prompt.sh
  93. . /usr/src/freeswitch.git/support-d/git-completion.bash
  94. export PS1='\n\[\033[01;31m\]\u@\h\[\033[01;36m\] [\d \@] \[\033[01;33m\] \w$(__git_ps1)\n\[\033[00m\]<\#>:'
  95. fi
  96. export PS2="\[\033[1m\]> \[\033[0m\]"
  97. if [ -f ~/.viplease ]; then
  98. if [ -f /usr/bin/vim ]; then
  99. export VISUAL=vim
  100. else
  101. export VISUAL=vi
  102. fi
  103. else
  104. export VISUAL=emacs
  105. fi
  106. export GIT_SSL_NO_VERIFY=true
  107. umask 022
  108. alias e='emacs'
  109. alias eamcs='emacs'
  110. alias emcas='emacs'
  111. alias meacs='emacs'
  112. alias mecas='emacs'
  113. alias bgit='git commit --author "Brian West <brian@freeswitch.org>"'
  114. alias mgit='git commit --author "Mike Jerris <mike@jerris.com>"'
  115. alias tgit='git commit --author "Anthony Minessale <anthm@freeswitch.org>"'
  116. alias dp='emacs $sysconfdir/dialplan/default.xml'
  117. alias go='$bindir/freeswitch -nonat'
  118. alias fstop='top -p `cat $runtimedir/freeswitch.pid`'
  119. alias fsgcore='gcore `cat $runtimedir/freeswitch.pid` && top -H -n1 -b > core.`cat $runtimedir/freeswitch.pid`.txt'
  120. alias fsgdb='gdb $bindir/freeswitch `cat $runtimedir/freeswitch.pid`'
  121. alias fscore='gdb $bindir/freeswitch `ls -rt core.* | tail -n1`'
  122. alias emacs='emacs -nw'
  123. if [ "${UNAME}" = "Linux" ]; then
  124. alias govg='valgrind --tool=memcheck --log-file=vg.log --leak-check=full --leak-resolution=high --show-reachable=yes .libs/freeswitch -vg'
  125. 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'
  126. alias jitteroff='tc qdisc del dev eth0 root netem'
  127. fi
  128. # Auto Update the .bashrc if hostname contains freeswitch.org
  129. if [[ $(hostname) =~ "freeswitch.org" ]]; then
  130. if [ -f /usr/src/freeswitch.git/support-d/.bashrc ]; then
  131. /usr/bin/diff --brief <(sort /usr/src/freeswitch.git/support-d/.bashrc) <(sort ~/.bashrc) >/dev/null
  132. if [ $? -eq 1 ]; then
  133. /bin/cp -f /usr/src/freeswitch.git/support-d/.bashrc ~/
  134. echo ".bashrc updated."
  135. source ~/.bashrc
  136. fi
  137. fi
  138. fi
  139. # End Auto Update
  140. # End of file