3 echo -n "Saving configuration... "
5 if [ ! -f /etc/diskless ]
7 echo "No flash setup detected."
12 [ -d "${1}" ] || return 1
13 find "${1}" -type f -not -regex '.*/tmp/*.' -newer /etc/diskless -print
17 [ -d "${1}" ] || return 1
18 find_newer_files "${1}" | cpio -o | gzip -9 > "/conf/default/${1}.cpio.gz"
21 # Mount /conf read-write, and remount if it already is.
22 if [ $(grep -c /conf /etc/fstab) -gt 0 ]
34 # Unlimited history method: (make sure you have provisions for removing the old backups, or this can get HUGE!
35 dest="$(date -r "$(stat -f '%c' "/conf/default")" "+%Y-%m-%dT%H-%M-%S")"
36 mv /conf/default "/conf/backup/${dest}"
41 # Copy changed config files to /conf/default (anything younger than /etc/diskless)
42 #find etc var -type f -not -regex '.*/tmp/.*' -newer /etc/diskless -print0 | cpio -p /conf/default/
43 # This can be changed to allow compressed configuration here as well:
47 # Umount /conf afterwards, if it wasn't mounted
48 if [ -z "${_was_mounted}" -a "$(mount |grep -c "/conf")" -gt 0 ]