r11:
authorIvan Rako <Ivan.Rako@CARNet.hr>
Mon, 21 Mar 2005 09:03:43 +0000 (09:03 +0000)
committerIvan Rako <Ivan.Rako@CARNet.hr>
Mon, 21 Mar 2005 09:03:43 +0000 (09:03 +0000)
functions.sh

index 6e01cfd..b4218d1 100644 (file)
@@ -114,11 +114,11 @@ cp_backup_conffile() {
   [ "$CP_SCRIPT_DEBUG" ] && set -vx
   local file_bak
 
-  if [ -z $1 ]; then
+  if [ -z "$1" ]; then
     echo "Usage: cp_backup_conffile <file>" 1>&2
     return 1
   fi
-  if [ ! -f $1 ]; then
+  if [ ! -f "$1" ]; then
     echo "cp_backup_conffile: $1: No such file" 1>&2
     return 1
   fi
@@ -126,9 +126,9 @@ cp_backup_conffile() {
   file_bak="/var/backups/`basename $1`.bak"
 
   if [ ! -f $file_bak ]; then
-    cp -pf $1 $file_bak
+    cp -pf "$1" $file_bak
   else
-    if ! cmp -s $1 $file_bak; then
+    if ! cmp -s "$1" $file_bak; then
       /usr/bin/savelog -p -c 7 $file_bak > /dev/null 2> /dev/null
       cp -pf $1 $file_bak
     fi