#!/bin/sh -e
#===============================================================================
#
#          FILE:  stategrid-custom-apply
# 
#         USAGE:  ./stategrid-custom-apply
# 
#   DESCRIPTION:  
# 
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: bqin (), bqin@linx-info.com
#       COMPANY: linx-info
#       CREATED: 2013年10月16日 15时05分03秒 CST
#      REVISION:  ---
#===============================================================================

. /usr/share/debconf/confmodule

db_get stategrid-custom/user_name
USERNAME="$RET"
db_get stategrid-custom/user_home
USERHOME="$RET"
db_get stategrid-custom/user_shell
USERSHELL="$RET"
echo USERNAME:$USERNAME 
echo USERHOME:$USERHOME
echo USERSHELL:$USERSHELL


cp -r /usr/lib/stategrid-custom-udeb/setup /target/tmp
mount /proc /target/proc
chroot /target ./tmp/setup/setup.sh $USERNAME $USERHOME $USERSHELL
chroot /target xdg-user-dirs-update
umount /target/proc

