use cgecho for green output

This commit is contained in:
Andreas Steffen
2007-08-03 10:58:45 +00:00
parent d49cc7b383
commit 90b21fde11
12 changed files with 37 additions and 36 deletions
+1 -1
View File
@@ -121,4 +121,4 @@ do
esac
done
cecho "done"
cgecho "done"
+6 -6
View File
@@ -37,25 +37,25 @@ if [ ! -f $LOGFILE ]
then
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
touch $LOGFILE
cecho "done"
cgecho "done"
fi
if [ ! -d ~/.ssh ]
then
cecho-n " * Creating directory '~/.ssh'.."
mkdir ~/.ssh
cecho "done"
cgecho "done"
fi
if [ -f ~/.ssh/known_hosts ]
then
cecho-n " * Backing up ~/.ssh/known_hosts to '~/.ssh/known_hosts.before_uml'.."
cp -fp ~/.ssh/known_hosts ~/.ssh/known_hosts.before_uml
cecho "done"
cgecho "done"
else
cecho-n " * Creating '~/.ssh/known_hosts'"
touch ~/.ssh/known_hosts
cecho "done"
cgecho "done"
fi
for host in $HOSTNAMEIPV4
@@ -68,7 +68,7 @@ do
else
cecho-n " * Adding uml host $HOSTNAME ($IP) to '~/.ssh/known_hosts'.."
echo "$HOSTNAME,$IP `cat $DIR/../hosts/ssh_host_rsa_key.pub`" >> ~/.ssh/known_hosts
cecho "done"
cgecho "done"
fi
done
@@ -84,5 +84,5 @@ else
cecho "not found"
cecho-n " * Generating ssh rsa key pair.."
echo "" | ssh-keygen -N "" -t rsa -f ~/.ssh/id_rsa >> $LOGFILE 2>&1
cecho "done"
cgecho "done"
fi
+3 -3
View File
@@ -32,7 +32,7 @@ if [ ! -d $BUILDDIR ]
then
cecho-n " * Directory '$BUILDDIR' does not exist..creating.."
mkdir $BUILDDIR
cecho "done"
cgecho "done"
fi
LOGFILE=${BUILDDIR}/testing.log
@@ -41,7 +41,7 @@ if [ ! -f $LOGFILE ]
then
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
touch $LOGFILE
cecho "done"
cgecho "done"
fi
LOOPDIR=loop
@@ -76,4 +76,4 @@ do
umount $LOOPDIR
done
cecho "done"
cgecho "done"
+5 -7
View File
@@ -75,12 +75,12 @@ if [ ! -f $LOGFILE ]
then
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
touch $LOGFILE
cecho "done"
cgecho "done"
fi
cecho-n " * Unpacking kernel.."
tar xjf $KERNEL >> $LOGFILE 2>&1
cecho "done"
cgecho "done"
KERNELDIR=${BUILDDIR}/linux-${KERNELVERSION}
@@ -109,7 +109,7 @@ if [ $UMLPATCH ]
then
cecho-n " * Applying uml patch.."
bzcat $UMLPATCH | patch -p1 >> $LOGFILE 2>&1
cecho "done"
cgecho "done"
fi
#######################################################
@@ -125,10 +125,8 @@ make oldconfig ARCH=um >> $LOGFILE 2>&1
cecho-n " * Now compiling uml kernel.."
make linux ARCH=um >> $LOGFILE 2>&1
cecho "done"
cgecho "done"
cecho-n " * Copying uml kernel to '${BUILDDIR}/linux-uml-${KERNELVERSION}'.."
mv linux ${BUILDDIR}/linux-uml-${KERNELVERSION}
cecho "done"
cgecho "done"
+4 -6
View File
@@ -57,7 +57,7 @@ if [ ! -f $LOGFILE ]
then
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
touch $LOGFILE
cecho "done"
cgecho "done"
fi
ROOTFSDIR=$BUILDDIR/root-fs
@@ -66,7 +66,7 @@ if [ ! -d $ROOTFSDIR ]
then
cecho-n " * Root file system directory '$ROOTFSDIR' does not exist..creating.."
mkdir $ROOTFSDIR
cecho "done"
cgecho "done"
fi
cd $ROOTFSDIR
@@ -87,7 +87,7 @@ dd if=/dev/zero of=gentoo-fs count=$ROOTFSSIZE bs=1M >> $LOGFILE 2>&1
mkreiserfs -q -f gentoo-fs >> $LOGFILE 2>&1
mount -o loop gentoo-fs $LOOPDIR >> $LOGFILE 2>&1
tar xjpf $ROOTFS -C $LOOPDIR >> $LOGFILE 2>&1
cecho "done"
cgecho "done"
######################################################
# remove /etc/resolv.conf
@@ -150,10 +150,8 @@ echo "ldconfig" >> $INSTALLSHELL
cecho-n " * Compiling $STRONGSWANVERSION within the root file system as chroot.."
chroot $LOOPDIR /bin/bash /install.sh >> $LOGFILE 2>&1
cecho "done"
rm -f $INSTALLSHELL
cgecho "done"
######################################################
# copying the host's ssh public key
+3
View File
@@ -24,6 +24,9 @@
function cecho {
echo -e "\033[1;31m$1\033[0m"
}
function cgecho {
echo -e "\033[1;32m$1\033[0m"
}
function cecho-n {
echo -en "\033[1;31m$1\033[0m"
+2 -2
View File
@@ -68,7 +68,7 @@ do
ubda=$UMLHOSTFS \
\$SWITCH_${host} \
mem=${MEM}M con=pty con0=fd:0,fd:1" &
cecho "\033[1;32mdone"
cgecho "done"
fi
let "x0+=dx"
let "y0+=dy"
@@ -114,7 +114,7 @@ do
cecho "exit"
exit 1
else
cecho "\033[1;32mup"
cgecho "up"
fi
done
+2 -2
View File
@@ -31,9 +31,9 @@ do
cecho " * Great, umlswitch$n is already running!"
else
cecho-n " * Starting umlswitch$n.."
uml_switch -tap tap$n -unix /tmp/umlswitch$n >/dev/null 2>&1 </dev/null &
uml_switch -tap tap$n -unix /tmp/umlswitch$n -daemon >/dev/null 2>&1 </dev/null
sleep 2
eval ifconfig "tap$n \$IFCONFIG_$n up"
cecho "\033[1;32mdone"
cgecho "done"
fi
done
+2 -2
View File
@@ -62,7 +62,7 @@ do
ubda=$UMLHOSTFS \
\$SWITCH_${host} \
mem=${MEM}M con=pty con0=fd:0,fd:1"
cecho "done"
cgecho "done"
fi
done
@@ -105,7 +105,7 @@ do
cecho "exit"
exit 1
else
cecho "up"
cgecho "up"
fi
done
+2 -2
View File
@@ -68,7 +68,7 @@ do
ubda=$UMLHOSTFS \
\$SWITCH_${host} \
mem=${MEM}M con=pty con0=fd:0,fd:1" &
cecho "done"
cgecho "done"
fi
let "x0+=dx"
let "y0+=dy"
@@ -114,7 +114,7 @@ do
cecho "exit"
exit 1
else
cecho "up"
cgecho "up"
fi
done