use tabs for indentation in shell scripts

This commit is contained in:
Marek Marczykowski 2013-02-16 15:27:44 +01:00
parent 91a632738d
commit 746cb149c9
2 changed files with 22 additions and 23 deletions

View File

@ -12,31 +12,30 @@ exit
fi fi
if [ "$VERBOSE" == "1" ]; then if [ "$VERBOSE" == "1" ]; then
export YUM_OPTS="$YUM_OPTS -q" export YUM_OPTS="$YUM_OPTS -q"
fi fi
if [ -f $IMG ]; then if [ -f $IMG ]; then
echo "-> Image file already exists, assuming *update*..." echo "-> Image file already exists, assuming *update*..."
mount -o loop $IMG mnt || exit 1 mount -o loop $IMG mnt || exit 1
export INSTALLDIR=`pwd`/mnt/ export INSTALLDIR=`pwd`/mnt/
else else
echo "-> Preparing instalation of $DIST template..." echo "-> Preparing instalation of $DIST template..."
scripts_"${DIST}"/00_prepare.sh scripts_"${DIST}"/00_prepare.sh
echo "-> Initializing empty image..." echo "-> Initializing empty image..."
truncate -s 10G $IMG || exit 1 truncate -s 10G $IMG || exit 1
echo "-> Creating filesystem..." echo "-> Creating filesystem..."
mkfs.ext4 -q -F $IMG || exit 1 mkfs.ext4 -q -F $IMG || exit 1
mkdir -p mnt mkdir -p mnt
mount -o loop $IMG mnt || exit 1 mount -o loop $IMG mnt || exit 1
export INSTALLDIR=`pwd`/mnt/ export INSTALLDIR=`pwd`/mnt/
scripts_"${DIST}"/01_install_core.sh scripts_"${DIST}"/01_install_core.sh
fi fi
PKGLISTFILE=$(shell [ -r scripts_"${DIST}/packages_$(DIST).list" ] && echo scripts_"${DIST}/packages_$(DIST).list" || echo scripts_"${DIST}/packages.list") PKGLISTFILE=$(shell [ -r scripts_"${DIST}/packages_$(DIST).list" ] && echo scripts_"${DIST}/packages_$(DIST).list" || echo scripts_"${DIST}/packages.list")

View File

@ -23,18 +23,18 @@ fi
ID=$(id -ur) ID=$(id -ur)
if [ $ID != 0 ] ; then if [ $ID != 0 ] ; then
echo "This script should be run as root user." echo "This script should be run as root user."
exit 1 exit 1
fi fi
if [ "$VERBOSE" == "1" ]; then if [ "$VERBOSE" == "1" ]; then
export YUM_OPTS="$YUM_OPTS -q" export YUM_OPTS="$YUM_OPTS -q"
fi fi
function cleanup() { function cleanup() {
if grep -q " $PWD/mnt " /proc/mounts; then if grep -q " $PWD/mnt " /proc/mounts; then
umount mnt/proc mnt umount mnt/proc mnt
fi fi
} }
trap cleanup ERR trap cleanup ERR
@ -64,9 +64,9 @@ echo "--> Creating the Apps Menu templates..."
echo "--> Choosing appmenus whitelists..." echo "--> Choosing appmenus whitelists..."
rm -f appmenus rm -f appmenus
if [ -d "appmenus_$DIST" ]; then if [ -d "appmenus_$DIST" ]; then
ln -s "appmenus_$DIST" appmenus ln -s "appmenus_$DIST" appmenus
else else
ln -s "appmenus_generic" appmenus ln -s "appmenus_generic" appmenus
fi fi
echo "--> Linking /home to /rw/home..." echo "--> Linking /home to /rw/home..."
@ -78,8 +78,8 @@ mv mnt/usr/local mnt/usr/local.orig
ln -sf /rw/usrlocal mnt/usr/local ln -sf /rw/usrlocal mnt/usr/local
if ! [ -r mnt/etc/sysconfig/i18n ]; then if ! [ -r mnt/etc/sysconfig/i18n ]; then
echo "--> Setting up default locale..." echo "--> Setting up default locale..."
echo LC_CTYPE=en_US.UTF-8 > mnt/etc/sysconfig/i18n echo LC_CTYPE=en_US.UTF-8 > mnt/etc/sysconfig/i18n
fi fi
echo "--> Unmounting $IMG" echo "--> Unmounting $IMG"