Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix zsh local and varnish function

  • Loading branch information...
commit 8d95120c67a71d675d00d2da55b68c9eabff7c9d 1 parent 098a7db
@pad92 authored
Showing with 16 additions and 18 deletions.
  1. +0 −5 .zshrc
  2. +16 −13 extras/function_varnish.zsh
View
5 .zshrc
@@ -28,11 +28,6 @@ export HISTSIZE=10000
export SAVEHIST=10000
export HISTIGNORE="&:ls:ll:la:l.:pwd:exit:clear:clr:[bf]g"
-export LANG="fr_FR.UTF-8"
-export LC_CTYPE=$LANG
-export LC_ALL=$LANG
-export TERM=screen-256color
-
setopt hist_ignore_dups
setopt share_history
View
29 extras/function_varnish.zsh
@@ -1,14 +1,17 @@
-if [ -x $(which varnishadm) ]; then
- varnish_reload () {
- VARNISHADM=$(which varnishadm)
- DATE=$(date +%Y%m%d_%H%M%S)
- $VARNISHADM "vcl.load $DATE /usr/local/etc/varnish/production.vcl"
- if [ $? -eq 0 ]
- then
- $VARNISHADM "vcl.use $DATE"
- echo "VCL used : $DATE"
- else
- echo "Fail to compile VCL"
- fi
- }
+which varnishadm 1>/dev/null 2>&1
+if (( $? == 0 )); then
+ if [ -x $(which varnishadm) ]; then
+ varnish_reload () {
+ VARNISHADM=$(which varnishadm)
+ DATE=$(date +%Y%m%d_%H%M%S)
+ $VARNISHADM "vcl.load $DATE /usr/local/etc/varnish/production.vcl"
+ if [ $? -eq 0 ]
+ then
+ $VARNISHADM "vcl.use $DATE"
+ echo "VCL used : $DATE"
+ else
+ echo "Fail to compile VCL"
+ fi
+ }
+ fi
fi
Please sign in to comment.
Something went wrong with that request. Please try again.