make savechanges accept optional CHANGES dir parameter

pull/40/head
TomasM 2017-10-18 08:45:58 -04:00
parent 3ba0878518
commit 86a0ea3d6b
1 changed files with 6 additions and 2 deletions

View File

@ -1,14 +1,18 @@
#!/bin/bash #!/bin/bash
TMP=/tmp/changes$$ TMP=/tmp/changes$$
CHANGES=/mnt/live/memory/changes
EXCLUDE="^\$|/\$|[.]wh[.][.]wh[.]orph/|^[.]wh[.][.]wh[.]plnk/|^[.]wh[.][.]wh[.]aufs|^var/cache/|^var/backups/|^var/tmp/|^var/log/|^var/lib/apt/|^var/lib/dhcp/|^var/lib/systemd/|^sbin/fsck[.]aufs|^etc/resolv[.]conf|^etc/fstab|^boot/|^dev/|^mnt/|^proc/|^run/|^sys/|^tmp/" EXCLUDE="^\$|/\$|[.]wh[.][.]wh[.]orph/|^[.]wh[.][.]wh[.]plnk/|^[.]wh[.][.]wh[.]aufs|^var/cache/|^var/backups/|^var/tmp/|^var/log/|^var/lib/apt/|^var/lib/dhcp/|^var/lib/systemd/|^sbin/fsck[.]aufs|^etc/resolv[.]conf|^etc/fstab|^boot/|^dev/|^mnt/|^proc/|^run/|^sys/|^tmp/"
CHANGES=/mnt/live/memory/changes
if [ "$1" = "" ]; then if [ "$1" = "" ]; then
echo "Usage: $0 [ target_file.sb ]" echo "Usage: $0 [ target_file.sb ] [ optional_changes_directory ]"
exit 1 exit 1
fi fi
if [ ! "$2" = "" ]; then
CHANGES="$2"
fi
# exclude the safe_file itself of course # exclude the safe_file itself of course
EXCLUDE="$EXCLUDE|^""$(readlink -f "$1" | cut -b 2- | sed -r "s/[.]/[.]/")""\$" EXCLUDE="$EXCLUDE|^""$(readlink -f "$1" | cut -b 2- | sed -r "s/[.]/[.]/")""\$"