Added colors to text output

This commit is contained in:
Justin Moore 2015-03-03 23:54:49 -06:00
parent 174cce4c68
commit a9c3e64f13
3 changed files with 31 additions and 22 deletions

View File

@ -76,66 +76,66 @@ echo "Checking dependencies...";echo
checkYoutubedl checkYoutubedl
if [ $? -eq "1" ];then if [ $? -eq "1" ];then
YSTATUS=0 YSTATUS=0
echo "is youtube-dl installed?: no" echo -e "is youtube-dl installed?: \e[31m no \033[0m"
else else
YSTATUS=1 YSTATUS=1
echo "is youtube-dl installed?: yes" echo -e "is youtube-dl installed?: \e[32m yes \033[0m"
fi fi
checkFfmpeg checkFfmpeg
if [ $? -eq "1" ];then if [ $? -eq "1" ];then
FSTATUS=0 FSTATUS=0
echo "is ffmpeg installed?: no" echo -e "is ffmpeg installed?: \e[31m no \033[0m"
else else
FSTATUS=1 FSTATUS=1
echo "is ffmpeg installed?: yes" echo -e "is ffmpeg installed?: \e[32m yes \033[0m"
fi fi
checkZenity checkZenity
if [ $? -eq "1" ];then if [ $? -eq "1" ];then
ZSTATUS=0 ZSTATUS=0
echo "is zenity installed?: no" echo -e "is zenity installed?: \e[31m no \033[0m"
else else
ZSTATUS=1 ZSTATUS=1
echo "is zenity installed?: yes" echo -e "is zenity installed?: \e[32m yes \033[0m"
fi fi
checkYad checkYad
if [ $? -eq "1" ];then if [ $? -eq "1" ];then
YASTATUS=0 YASTATUS=0
echo "is yad install?: no" echo -e "is yad install?: \e[31m no \033[0m"
else else
YASTATUS=1 YASTATUS=1
echo "is yad installed?: yes" echo -e "is yad installed?: \e[32m yes \033[0m (Optional)"
fi fi
checkXdg checkXdg
if [ $? -eq "1" ];then if [ $? -eq "1" ];then
XSTATUS=0 XSTATUS=0
echo "is xdg-utils install?: no" echo -e "is xdg-utils install?: \e[31m no \033[0m"
else else
XSTATUS=1 XSTATUS=1
echo "is xdg-utils installed?: yes" echo -e "is xdg-utils installed?: \e[32m yes \033[0m"
fi fi
checkNotify checkNotify
if [ $? -eq "1" ];then if [ $? -eq "1" ];then
NSTATUS=0 NSTATUS=0
echo "is libnotify install?: no" echo -e "is libnotify install?: \e[31m no \033[0m"
else else
NSTATUS=1 NSTATUS=1
echo "is libnotify installed?: yes" echo -e "is libnotify installed?: \e[32m yes \033[0m"
fi fi
checkInstall checkInstall
if [ $? -eq "1" ];then if [ $? -eq "1" ];then
ISTATUS=0 ISTATUS=0
echo "does ${INSTALLPATH} exist?: no" echo -e "does ${INSTALLPATH} exist?: \e[31m no \033[0m"
else else
ISTATUS=1 ISTATUS=1
echo "does ${INSTALLPATH} exist?: yes" echo -e "does ${INSTALLPATH} exist?: \e[32m yes \033[0m"
fi fi
if [ ${ISTATUS} = 0 ];then if [ ${ISTATUS} = 0 ];then
@ -151,15 +151,15 @@ fi
#add all exit status variables and check the sum #add all exit status variables and check the sum
#if a certain number is not reached, the check fails #if a certain number is not reached, the check fails
#if the check succeeds, files are installed #if the check succeeds, files are installed
#TODO add checks to verify installation ALLSTATUS=$(expr ${YSTATUS} + ${FSTATUS} + ${ZSTATUS} + ${XSTATUS} + ${ISTATUS})
ALLSTATUS=$(expr ${YSTATUS} + ${FSTATUS} + ${ZSTATUS} + ${XSTATUS} + ${NSTATUS} + ${ISTATUS})
if [ ${ALLSTATUS} != 6 ];then if [ ${ALLSTATUS} != 5 ];then
echo "$0 : ERROR : not all dependencies installed!" echo "$0 : ERROR : not all dependencies installed!"
exit 0; exit 0;
else else
echo "Everything looks good!" echo
echo -e "\e[92mEverything looks good!\033[0m"
echo echo
echo -n "Continue installation?[y/n]: " echo -n "Continue installation?[y/n]: "
read confirm read confirm
@ -181,7 +181,8 @@ else
echo "Zymp3 not installed successfully" echo "Zymp3 not installed successfully"
echo "Please file a bug report at: https://github.com/silvernode/zymp3/issues" echo "Please file a bug report at: https://github.com/silvernode/zymp3/issues"
else else
echo "Zymp3 successfully installed to: ${INSTALLPATH}" echo "====================================================="
echo -e "\e[92mZymp3 successfully installed to: ${INSTALLPATH}\033[0m"
echo "An icon has been created in your application menu under the multimedia category." echo "An icon has been created in your application menu under the multimedia category."
fi fi
else else

View File

@ -29,7 +29,7 @@ fi
COUNT=$(expr ${INSTALLDIR} + ${BINFILE} + ${DESKTOPFILE}) COUNT=$(expr ${INSTALLDIR} + ${BINFILE} + ${DESKTOPFILE})
if [ "${COUNT}" = "3" ];then if [ "${COUNT}" = "3" ];then
echo "Looks like zymp3 is still installed" echo -e "\e[93m Looks like zymp3 is still installed \033[0m"
echo -n "Would you like to remove all files?[y/n]: " echo -n "Would you like to remove all files?[y/n]: "
read CHOICE read CHOICE
@ -41,7 +41,7 @@ if [ "${COUNT}" = "3" ];then
COUNT=$(expr ${INSTALLDIR} + ${BINFILE} + ${DESKTOPFILE}) COUNT=$(expr ${INSTALLDIR} + ${BINFILE} + ${DESKTOPFILE})
if [ "${COUNT}" = "0" ];then if [ "${COUNT}" = "0" ];then
echo "Zymp3 has been successfully is uninstalled" echo -e "\e[92m Zymp3 has been successfully is uninstalled \033[0m"
else else
echo "$COUNT" echo "$COUNT"
echo "It seems the uninstall did not go smoothly." echo "It seems the uninstall did not go smoothly."

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
source config/zymp3.conf
if [[ $EUID -eq 0 ]]; then if [[ $EUID -eq 0 ]]; then
echo "$0 : Do not run this script as root" echo "$0 : Do not run this script as root"
exit 1 exit 1
@ -7,6 +9,12 @@ fi
if [ -d .git ];then if [ -d .git ];then
git pull git pull
if [ $? = 1 ];then
echo "Git was unable to complete successfully."
else
echo "Please run 'install.sh' to apply updated files"
fi
else else
echo "This is not a git repo, aborting" echo "This is not a git repo, aborting"
exit 0; exit 0;