diff options
author | rjorgenson <rjorgenson@gmail.com> | 2017-01-04 02:05:15 +0300 |
---|---|---|
committer | rjorgenson <rjorgenson@gmail.com> | 2017-01-04 02:05:15 +0300 |
commit | fa51798ce76fd5e50ac7be2fee333e090697ef17 (patch) | |
tree | f726273570f2feb64bbf121de254ca280e8c9529 /powerlevel9k.zsh-theme | |
parent | 5cf78c5a1314967b86e37dc330f889e3c5cba805 (diff) |
fixed some comments and handled an edge case
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index f5c810bc..dd57ac05 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -460,10 +460,11 @@ prompt_public_ip() { if [[ -z "$fresh_ip" ]] && type -p wget >/dev/null; then fresh_ip="$(wget -T 10 -qO- "$POWERLEVEL9K_PUBLIC_IP_HOST" 2> /dev/null)" fi - [[ -n $fresh_ip ]] && echo $fresh_ip > $POWERLEVEL9K_PUBLIC_IP_FILE + # write IP to tmp file or touch tmp file if an IP was not retrieved + [[ -n $fresh_ip ]] && echo $fresh_ip > $POWERLEVEL9K_PUBLIC_IP_FILE || touch $POWERLEVEL9K_PUBLIC_IP_FILE fi - # write IP to tmp file + # read public IP saved to tmp file local public_ip=$(cat $POWERLEVEL9K_PUBLIC_IP_FILE) if [[ -n $public_ip ]]; then |