From c4286feabef25b417d05251e4a63ef769ac4cfad Mon Sep 17 00:00:00 2001
From: quiver <george@alpamayo.(none)>
Date: Fri, 4 May 2012 20:07:00 +0900
Subject: [PATCH] fix several bugs of init.d scripts

- PIDFILE environ variable was not properly retrieved
- chkconfig command failed
---
 utils/install_server.sh     | 2 +-
 utils/redis_init_script.tpl | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/install_server.sh b/utils/install_server.sh
index 06570a87f..93b5b411b 100755
--- a/utils/install_server.sh
+++ b/utils/install_server.sh
@@ -166,7 +166,7 @@ if [[ ! `which chkconfig` ]] ; then
 else
 	# we're chkconfig, so lets add to chkconfig and put in runlevel 345
 	chkconfig --add redis_$REDIS_PORT && echo "Successfully added to chkconfig!"
-	chkconfig--level 345 redis_$REDIS_PORT on && echo "Successfully added to runlevels 345!"
+	chkconfig --level 345 redis_$REDIS_PORT on && echo "Successfully added to runlevels 345!"
 fi
 	
 /etc/init.d/redis_$REDIS_PORT start || die "Failed starting service..."
diff --git a/utils/redis_init_script.tpl b/utils/redis_init_script.tpl
index e0c5b2f88..e2af1fe77 100755
--- a/utils/redis_init_script.tpl
+++ b/utils/redis_init_script.tpl
@@ -1,7 +1,7 @@
 
 case "$1" in
     start)
-        if [ -f $$PIDFILE ]
+        if [ -f $PIDFILE ]
         then
                 echo "$PIDFILE exists, process is already running or crashed"
         else