#!/bin/sh
##############################################################################
#
#  Copyright (c) 2005, Doremi Labs, Inc.
#    All rights reserved.
#
#  Redistribution in source or binary forms, with or without
#  modification, are NOT permitted.
#
#    Doremi Labs, Inc.
#    1020 Chestnut St.
#    Burbank, CA 91506
#    Tel : (818) 562 1101
#    Fax : (818) 562 1109
#
##############################################################################

. $(dirname $0)/../common.sh

FILE_LIST="/etc/hostname
/etc/hosts.allow
/etc/hosts.deny
/etc/passwd
/etc/shadow
/etc/group
/etc/group-
/etc/gshadow
/etc/gshadow-
/doremi/etc/users.xml
/etc/timezone
/etc/localtime
/var/etc/adjtime"

PERM_LIST="/etc/hostname[root:root]
/etc/hosts.allow[root:root]
/etc/hosts.deny[root:root]
/etc/passwd[root:root]
/etc/shadow[root:shadow]
/etc/group[root:root]
/etc/group-[root:root]
/etc/gshadow[root:shadow]
/etc/gshadow-[root:root]
/etc/timezone[root:root]
/etc/localtime[root:root]
/var/etc/adjtime[root:root]"

do_backup ()
{
  safe_backup $FILE_LIST
}

do_restore ()
{
  safe_restore $FILE_LIST
}

case "$1" in
  backup)
    do_backup
    ;;
    
  restore)
    do_restore
    ;;
    
  *)
    echo "Usage: $0 [backup] [restore]"
    exit -1
    ;;
esac

exit 0
