Commit f428f2d0 authored by w4t's avatar w4t

wtserver 0.37

parent 4d93ff62
......@@ -3,7 +3,7 @@
# Install and configure SQL Server (MySQL or MariaDB)
#---------------------------------------------------------------------
InstallSQLServer() {
START_TIME=$(date +%s.%N)
local START_TIME=$(date +%s.%N)
if [ $CFG_SQLSERVER == "MySQL" ]; then
echo -n -e "$IDENTATION_LVL_0 ${BWhite}Installing MySQL${NC}\n"
......@@ -255,9 +255,5 @@ EOF
echo -n "${red}No database server installation selected... ${NC}"
fi
END_TIME=$(date +%s.%N)
ELAPSED_TIME_SEC=$(echo "$END_TIME - $START_TIME" | bc)
ELAPSED_TIME_MIN=$(echo "scale=2; $ELAPSED_TIME_SEC / 60" | bc)
echo "Time has passed: $ELAPSED_TIME_MIN minutes"
#MeasureTimeDuration $START_TIME
MeasureTimeDuration $START_TIME
}
......@@ -3,15 +3,32 @@
# Calculate the duration and display it
#---------------------------------------------------------------------
#MeasureTimeDuration() {
# if [ -z "$1" ]; # Is parameter #1 zero length?
# then
# echo "-Parameter #1 is zero length." # Or no parameter passed.
# else
# ELAPSED_TIME=$(($SECONDS - $1))
# echo -n -e "$IDENTATION_LVL_0 ${green}Completed ON ${NC}"
# echo -e ": ${red} $(($ELAPSED_TIME/60)) min $(($ELAPSED_TIME%60)) sec ${NC}"
# echo
# fi
#}
MeasureTimeDuration() {
if [ -z "$1" ]; # Is parameter #1 zero length?
then
echo "-Parameter #1 is zero length." # Or no parameter passed.
else
ELAPSED_TIME=$(($SECONDS - $1))
echo -n -e "$IDENTATION_LVL_0 ${green}Completed ON ${NC}"
echo -e ": ${red} $(($ELAPSED_TIME/60)) min $(($ELAPSED_TIME%60)) sec ${NC}"
echo
fi
if [ -z "$1" ]; then
echo "-Parameter #1 is zero length." # Or no parameter passed.
else
# Kiszámítjuk az eltelt időt nanoszekundumos pontossággal
END_TIME=$(date +%s.%N)
ELAPSED_TIME=$(echo "$END_TIME - $1" | bc)
# Percek és másodpercek kiszámítása
MINUTES=$(echo "scale=0; $ELAPSED_TIME/60" | bc)
SECONDS=$(echo "scale=1; $ELAPSED_TIME-($MINUTES*60)" | bc)
echo -n -e "$IDENTATION_LVL_0 ${green}Completed ON ${NC}"
echo -e ": ${red} $MINUTES min $SECONDS sec ${NC}"
echo
fi
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment