Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wtlinux_server_setup
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
w4t
wtlinux_server_setup
Commits
f428f2d0
Commit
f428f2d0
authored
Mar 12, 2025
by
w4t
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wtserver 0.37
parent
4d93ff62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
16 deletions
+29
-16
install_mysql.sh
distros/debian12/install_mysql.sh
+2
-6
04_measure_duration_and_echo.sh
functions/04_measure_duration_and_echo.sh
+27
-10
No files found.
distros/debian12/install_mysql.sh
View file @
f428f2d0
...
...
@@ -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
}
functions/04_measure_duration_and_echo.sh
View file @
f428f2d0
...
...
@@ -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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment