david/myzsh
david
/
myzsh
Archived
1
0
Fork 0

pushzshconfig 18.01.2013 21:41

This commit is contained in:
david 2013-01-18 21:41:21 +01:00
parent 117170e982
commit 233dd6d600
2 changed files with 21 additions and 7 deletions

View File

@ -99,10 +99,24 @@ update()
info()
{
echo "dns server(s):"
cat /etc/resolv.conf | grep --color=never nameserver
echo ""
echo "ip address(es):"
ip -f inet addr | grep inet | grep -v 127.0.0.1 | awk {'print $2'}
ip -f inet6 addr | grep inet6 | grep -v "::1/128" | grep -v "fe80:" | awk '{print $2 "\t" $5}'
echo -e "hostname: $(hostname)"
echo -e "dns server(s): "
nameservers=$(cat /etc/resolv.conf | grep --color=never nameserver | awk '{print $2}')
for server in $nameservers; do
echo -e "$server"
done
devices=$(ip link | awk '/^[0,2-9]*:/ {print $2}' | sed -e 's/: / /g' | sed -e 's/://g')
for device in $devices; do
ips=$(ip -f inet addr show dev $device | awk '/inet/ {print $2}')
echo -e "$device:"
for ip in $ips; do
echo -e "$ip, \c"
done
done
#ip -f inet addr | grep inet | grep -v 127.0.0.1 | awk {'print $2'}
#ip -f inet6 addr | grep inet6 | grep -v "::1/128" | grep -v "fe80:" | awk '{print $2}'
}

View File

@ -2,7 +2,7 @@ PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[bl
# RPS1='%{$fg[blue]%}%~%{$reset_color%} '
#RPS1='%{$fg[white]%}%2~$(git_prompt_info) %{$fg_bold[blue]%}%m%{$reset_color%}'
RPS1='%{$fg[white]%} %{$fg_bold[cyan]%}$(hostname)%{$reset_color%}'
RPS1='%{$fg[white]%} %{$fg_bold[cyan]%}$(hostname --short)%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"