Newer
Older
if [ $? != 0 ]; then
echo "Error: Module not found"
return 1
fi
local MODROOT="$(echo "$ML" | grep "EBROOT" | cut -d ',' -f 2 | cut -d '"' -f 2)"
local MODFILE="$(echo "$ML" | head -n3 | grep "\/[^[:space:]]*:" | tr -d ': ')"
if [ $? == 0 ]; then
echo -e "\r[\e[32m OK \e[0m] Removing root directory: $MODROOT"
else
echo -e "\r[\e[31mFAIL\e[0m] Removing root directory: $MODROOT"
fi
if [ -L "$MODFILE" ]; then
local MODFILE2="$(readlink "$MODFILE")"
if [ $? == 0 ]; then
echo -e "\r[\e[32m OK \e[0m] Removing link to modfile: $MODFILE"
else
echo -e "\r[\e[31mFAIL\e[0m] Removing link to modfile: $MODFILE"
fi
echo -ne "[ ] Removing modfile: $MODFILE2"
if [ $? == 0 ]; then
echo -e "\r[\e[32m OK \e[0m] Removing modfile: $MODFILE2"
else
echo -e "\r[\e[31mFAIL\e[0m] Removing modfile: $MODFILE2"
fi
else
echo -ne "[ ] Removing modfile: $MODFILE\r"
if [ $? == 0 ]; then
echo -e "[\e[32m OK \e[0m] Removing modfile: $MODFILE"
else
echo -e "[\e[31mFAIL\e[0m] Removing modfile: $MODFILE"
fi
fi
}