From 79df8bafa66e47bed24bfd062e86d5c5a51b60f7 Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 5 Jan 2015 13:09:25 -0600 Subject: [PATCH] Auto update .bashrc if hostname contains freeswitch.org --- support-d/.bashrc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/support-d/.bashrc b/support-d/.bashrc index 595c6fccb0..05b3b38149 100644 --- a/support-d/.bashrc +++ b/support-d/.bashrc @@ -1,5 +1,5 @@ # -# /etc/profile: system-wide defaults for bash(1) login shells +# FreeSWITCH Dev .bashrc # export UNAME=`uname -s` @@ -60,7 +60,6 @@ alias mecas='emacs' alias bgit='git commit --author "Brian West "' alias mgit='git commit --author "Mike Jerris "' alias tgit='git commit --author "Anthony Minessale "' -alias igit='git commit --author "Raymond Chandler "' alias dp='emacs /usr/local/freeswitch/conf/dialplan/default.xml' alias go='/usr/local/freeswitch/bin/freeswitch -nonat' alias fstop='top -p `cat /usr/local/freeswitch/run/freeswitch.pid`' @@ -69,4 +68,18 @@ alias fscore='gdb /usr/local/freeswitch/bin/freeswitch `ls -rt core.* | tail -n1 alias emacs='emacs -nw' 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' alias jitteroff='tc qdisc del dev eth0 root netem' + +# Auto Update the .bashrc if hostname contains freeswitch.org +if [[ $(hostname) =~ "freeswitch.org" ]]; then + if [ -f /usr/src/freeswitch.git/support-d/.bashrc ]; then + /usr/bin/diff --brief <(sort /usr/src/freeswitch.git/support-d/.bashrc) <(sort ~/.bashrc) >/dev/null + if [ $? -eq 1 ]; then + /bin/cp -f /usr/src/freeswitch.git/support-d/.bashrc ~/ + echo ".bashrc updated." + source ~/.bashrc + fi + fi +fi +# End Auto Update + # End of file