Skip to content
Snippets Groups Projects
Verified Commit 178bae40 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

Merge branch 'unbound-eaten'

parents 76904f73 80cbfba2
No related branches found
No related tags found
No related merge requests found
......@@ -11,3 +11,7 @@ For example, to add files /etc/a and /etc/b and remove /etc/c and /etc/d, you'd
call it as:
./cert-backup /etc/a /etc/b -r /etc/c -r /etc/d
In addition to -r, a file name may be prefixed with -x. In such case, the file
is extracted from the backup, not stored. As with -r, -x modifies behaviour for
only the single following file.
#!/bin/sh
# Copyright (c) 2013, CZ.NIC, z.s.p.o. (http://www.nic.cz/)
# Copyright (c) 2013-2015, CZ.NIC, z.s.p.o. (http://www.nic.cz/)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
......@@ -38,6 +38,10 @@ while [ "$1" ] ; do
# It should be removed, if it exists
shift
rm -f "$WORKDIR"/"$1"
elif [ "$1" = '-x' ] ; then
# Reverse, extractor mode
shift
cp -a "$WORKDIR"/"$1" "$1"
elif cmp -s "$1" "$WORKDIR"/"$1" ; then
echo "$1" already stored, skipping
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment