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
if [ "$VERBOSE" == "1" ]; then
export YUM_OPTS="$YUM_OPTS -q"
export YUM_OPTS="$YUM_OPTS -q"
fi
if [ -f $IMG ]; then
echo "-> Image file already exists, assuming *update*..."
mount -o loop $IMG mnt || exit 1
export INSTALLDIR=`pwd`/mnt/
echo "-> Image file already exists, assuming *update*..."
mount -o loop $IMG mnt || exit 1
export INSTALLDIR=`pwd`/mnt/
else
echo "-> Preparing instalation of $DIST template..."
echo "-> Preparing instalation of $DIST template..."
scripts_"${DIST}"/00_prepare.sh
echo "-> Initializing empty image..."
truncate -s 10G $IMG || exit 1
echo "-> Initializing empty image..."
truncate -s 10G $IMG || exit 1
echo "-> Creating filesystem..."
mkfs.ext4 -q -F $IMG || exit 1
echo "-> Creating filesystem..."
mkfs.ext4 -q -F $IMG || exit 1
mkdir -p mnt
mount -o loop $IMG mnt || exit 1
mkdir -p mnt
mount -o loop $IMG mnt || exit 1
export INSTALLDIR=`pwd`/mnt/
export INSTALLDIR=`pwd`/mnt/
scripts_"${DIST}"/01_install_core.sh
fi
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)
if [ $ID != 0 ] ; then
echo "This script should be run as root user."
exit 1
echo "This script should be run as root user."
exit 1
fi
if [ "$VERBOSE" == "1" ]; then
export YUM_OPTS="$YUM_OPTS -q"
export YUM_OPTS="$YUM_OPTS -q"
fi
function cleanup() {
if grep -q " $PWD/mnt " /proc/mounts; then
umount mnt/proc mnt
fi
if grep -q " $PWD/mnt " /proc/mounts; then
umount mnt/proc mnt
fi
}
trap cleanup ERR
@ -64,9 +64,9 @@ echo "--> Creating the Apps Menu templates..."
echo "--> Choosing appmenus whitelists..."
rm -f appmenus
if [ -d "appmenus_$DIST" ]; then
ln -s "appmenus_$DIST" appmenus
ln -s "appmenus_$DIST" appmenus
else
ln -s "appmenus_generic" appmenus
ln -s "appmenus_generic" appmenus
fi
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
if ! [ -r mnt/etc/sysconfig/i18n ]; then
echo "--> Setting up default locale..."
echo LC_CTYPE=en_US.UTF-8 > mnt/etc/sysconfig/i18n
echo "--> Setting up default locale..."
echo LC_CTYPE=en_US.UTF-8 > mnt/etc/sysconfig/i18n
fi
echo "--> Unmounting $IMG"