v0.5 - Now with extra colours!

master
Robert "ar" Gerus 2013-04-30 12:00:35 +02:00
parent 5f77c40004
commit dc5c20ba1f
1 changed files with 11 additions and 6 deletions

View File

@ -1,23 +1,27 @@
#!/busybox sh
NORMAL="\\033[0m"
FAIL="\\033[1;31m"
OK="\\033[1;32m"
INFO="\\033[1;34m"
die() {
echo ""
echo "Shit broke! Panic shell!"
echo -e "${FAIL}Shit broke! Panic shell!${NORMAL}"
echo ""
/busybox --install -s
exec /bin/sh
}
info() {
echo -n "-|-" ${@} "... "
echo -en "-${INFO}|${NORMAL}-" ${@} "... "
}
isok() {
if [[ $1 -eq 0 ]]; then
echo "[ OK ]"
echo -e "${INFO}[ ${OK}OK${INFO} ]${NORMAL}"
else
echo "[ FUCK ]"
echo -e "${INFO}[ ${FAIL}FUCK${INFO} ]${NORMAL}"
die
fi
}
@ -90,6 +94,7 @@ info "checking if ${filename} exists"
isok $?
info "unpacking; will take some time"
echo ""
/pv /mnt/${filename} | /busybox tar -C /roottmpfs -xJf -
info "unmounting rootfs package location"
@ -108,7 +113,7 @@ info "trying to switch root"
exec /busybox switch_root /roottmpfs /sbin/init
echo ""
echo "we should not reach this place! here be dragons!"
echo -e "${FAIL}we should not reach this place! here be dragons!${NORMAL}"
echo ""
die