1 --- /dev/null 2010-01-30 08:55:01.000000000 +0000
2 +++ sbin/saveconfig 2010-01-24 11:02:05.000000000 +0000
6 +echo -n "Saving configuration... "
8 +if [ ! -f /etc/diskless ]
10 + echo "No flash setup detected."
15 + [ -d "${1}" ] || return 1
16 + find "${1}" -type f -not -regex '.*/tmp/*.' -newer /etc/diskless -print
20 + [ -d "${1}" ] || return 1
21 + find_newer_files "${1}" | cpio -o | gzip -9 > "/conf/default/${1}.cpio.gz"
24 +# Mount /conf read-write, and remount if it already is.
25 +if [ $(grep -c /conf /etc/fstab) -gt 0 ]
37 +# Unlimited history method: (make sure you have provisions for removing the old backups, or this can get HUGE!
38 +dest="$(date -r "$(stat -f '%c' "/conf/default")" "+%Y-%m-%dT%H-%M-%S")"
39 +mv /conf/default "/conf/backup/${dest}"
44 +# Copy changed config files to /conf/default (anything younger than /etc/diskless)
45 +#find etc var -type f -not -regex '.*/tmp/.*' -newer /etc/diskless -print0 | cpio -p /conf/default/
46 +# This can be changed to allow compressed configuration here as well:
50 +# Umount /conf afterwards, if it wasn't mounted
51 +if [ -z "${_was_mounted}" -a "$(mount |grep -c "/conf")" -gt 0 ]