From: Keith Amidon Date: Tue, 7 Apr 2009 23:35:44 +0000 (-0700) Subject: Add appropriate extension to profile.d script. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b81b532268b68eb22d31ad2e78defd4cce45892c;p=openvswitch Add appropriate extension to profile.d script. --- diff --git a/vswitchd/etc/profile.d/vswitch b/vswitchd/etc/profile.d/vswitch deleted file mode 100644 index 79f57c33..00000000 --- a/vswitchd/etc/profile.d/vswitch +++ /dev/null @@ -1,49 +0,0 @@ -PATH=/root/vswitch/bin:$PATH -export PATH -MANPATH=/root/vswitch/share/man:$MANPATH -export MANPATH - -alias vswitch='service vswitch' - -function watchconf { - watch cat /etc/vswitchd.conf -} - -function watchdp { - watch dpctl dp-show "$@" -} - -function watchdpflows { - local grep="" - local dp=$1 - shift - if [ $# -gt 0 ]; then - grep="| grep $@" - fi - watch "dpctl dp-dump-flows $dp $grep" -} - -function watchflows { - local grep="" - local dp=$1 - shift - bridge=$(dpctl dp-show $dp | grep 'port 0:' | cut -d' ' -f 3) - if [ $# -gt 0 ]; then - grep="| grep $@" - fi - watch "dpctl dump-flows unix:/var/run/$bridge.mgmt $grep" -} - -function monitorlogs { - local grep="" - if [ $# -gt 0 ]; then - grep="| grep --line-buffered '^==> .* <==$" - for i in "$@"; do - grep="$grep\|$i" - done - grep="$grep'" - fi - cmd="tail -F /var/log/messages /var/log/vswitchd.log /var/log/xensource.log $grep | tee /var/log/monitorlogs.out" - printf "cmd: $cmd\n" - eval "$cmd" -} diff --git a/vswitchd/etc/profile.d/vswitch.sh b/vswitchd/etc/profile.d/vswitch.sh new file mode 100644 index 00000000..79f57c33 --- /dev/null +++ b/vswitchd/etc/profile.d/vswitch.sh @@ -0,0 +1,49 @@ +PATH=/root/vswitch/bin:$PATH +export PATH +MANPATH=/root/vswitch/share/man:$MANPATH +export MANPATH + +alias vswitch='service vswitch' + +function watchconf { + watch cat /etc/vswitchd.conf +} + +function watchdp { + watch dpctl dp-show "$@" +} + +function watchdpflows { + local grep="" + local dp=$1 + shift + if [ $# -gt 0 ]; then + grep="| grep $@" + fi + watch "dpctl dp-dump-flows $dp $grep" +} + +function watchflows { + local grep="" + local dp=$1 + shift + bridge=$(dpctl dp-show $dp | grep 'port 0:' | cut -d' ' -f 3) + if [ $# -gt 0 ]; then + grep="| grep $@" + fi + watch "dpctl dump-flows unix:/var/run/$bridge.mgmt $grep" +} + +function monitorlogs { + local grep="" + if [ $# -gt 0 ]; then + grep="| grep --line-buffered '^==> .* <==$" + for i in "$@"; do + grep="$grep\|$i" + done + grep="$grep'" + fi + cmd="tail -F /var/log/messages /var/log/vswitchd.log /var/log/xensource.log $grep | tee /var/log/monitorlogs.out" + printf "cmd: $cmd\n" + eval "$cmd" +}