You've already forked mariadb-ubuntu
logic changes
This commit is contained in:
@@ -10,17 +10,16 @@
|
|||||||
#
|
#
|
||||||
if [[ $(id -u) -ne 0 ]]; then echo "" && echo "Must be root or use sudo" && echo "" ; exit 1 ; fi
|
if [[ $(id -u) -ne 0 ]]; then echo "" && echo "Must be root or use sudo" && echo "" ; exit 1 ; fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check if services are allready running
|
||||||
|
#
|
||||||
|
for svc in mariadb; do if systemctl is-active --quiet "$svc"; then printf "\n%s is already running, cannot continue...\n\n" "${svc^}" ; exit 1 ; fi ; done
|
||||||
|
|
||||||
#
|
#
|
||||||
# Define variables
|
# Define variables
|
||||||
#
|
#
|
||||||
mariaconfig="/etc/mysql/mariadb.conf.d/50-server.cnf"
|
mariaconfig="/etc/mysql/mariadb.conf.d/50-server.cnf"
|
||||||
|
|
||||||
#
|
|
||||||
# Function to check if a service is already running or not
|
|
||||||
#
|
|
||||||
serviceyes () { printf "\n%s" $service ; printf " is already running cannot continue...\n\n"; }
|
|
||||||
servicealive () { status=$(systemctl is-active $service); if [[ "$status" == "active" ]]; then serviceyes ; exit 1; fi; }
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Function usage
|
# Function usage
|
||||||
#
|
#
|
||||||
@@ -35,11 +34,6 @@ printf -- "Example:\n"
|
|||||||
printf -- " sudo ./mariadbinstall -u adminuser -p strongpass\n\n"
|
printf -- " sudo ./mariadbinstall -u adminuser -p strongpass\n\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# If MariaDB is already running then die
|
|
||||||
#
|
|
||||||
service="mariadb" ; servicealive
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Let's go
|
# Let's go
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user