Imported sources from subversion.

This commit is contained in:
Ricardo Martins
2013-07-13 17:19:22 +01:00
commit 12d63d1569
455 changed files with 69857 additions and 0 deletions

37
mknfs.bash Executable file
View File

@@ -0,0 +1,37 @@
#! /bin/bash
#############################################################################
# $Id:: Helps deploying an archive to a folder in an easy way. $:#
#############################################################################
# Check shell type.
if [ -z "$BASH_VERSION" ]; then
echo "ERROR: you must use bash to run this script."
exit 1
fi
if [ $# -ne 1 ]; then
echo "Usage: $0 <config>"
exit 1
fi
if ! [ -f "$1" ]; then
echo "ERROR: configuration file '$1' does not exist."
exit 1
fi
source "$1"
# Creating a new folder:
target="${cfg_dir_base}/nfs/${cfg_hostname}"
sudo rm -rf ${target}
mkdir -p ${target}
# Copy the content of the file to our NFS folder:
sudo tar -pxf ${cfg_rootfs_tar} -C ${target}
# We want our resolve file and host file:
sudo rm "${target}/etc/resolv.conf"
sudo cp "/etc/resolv.conf" "${target}/etc/resolv.conf"
sudo rm "${target}/etc/hosts"
sudo cp "/etc/hosts" "${target}/etc/hosts"