anchor.diff:        exit 1
       fi
     done
  -  rm -rf $ssl_dir
  -  mkdir -p $ssl_dir
  +  if test -e "$ssl_dir"; then rm -r "$ssl_dir"; fi
  +  mkdir -m 700 "$ssl_dir"
     echo "Copying files: ${orig_ca_file}, ${orig_private_file} and ${orig_public_file} to ${ssl_dir}"
  -  cp -pr $orig_ca_file $ca_file
  -  cp -pr $orig_private_file $private_file
  -  cp -pr $orig_public_file $public_file
  +  cp -p "$orig_ca_file" "$ca_file"
  +  cp -p "$orig_private_file" "$private_file"
  +  cp -p "$orig_public_file" "$public_file"
   }
   
   ########
  
positive.code: #    appendline "mysetting = myvalue" /etc/myconfig
  #
  function appendline {
    backupfile $2
    tmp=$2.tmp.`date +%s`
    cat $2 > ${tmp}
    echo $1 >> ${tmp}
    mv ${tmp} $2
  }
  
  # This function copies the necessary PEM files from Puppet to the PuppetDB
  
negative.code: #    commentline "^$mysetting.*" /etc/myconfig
  #
  function commentline {
    local regex="$1" file="$2"
    backupfile "$file"
    tmp="$file.tmp.$(date +%s)"
    cp -p "$file" "$tmp"  # preserve perms
    sed "/$regex/ s/^/# /" "$file" > "$tmp"
    mv "$tmp" "$file"
  }
  
  # This function appends a line to a file
  #
  # $1 - string to append (will be followed by a newline)
  # $2 - file to operate on
  #
  # Example:
  