Debian Codegraph @

packaging/deb-in/extra/mysqlrouter-systemd-start

raw
1 #!/bin/bash
2
3 # Copyright (c) 2020, 2026, Oracle and/or its affiliates.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License, version 2.0,
7 # as published by the Free Software Foundation.
8 #
9 # This program is designed to work with certain software (including
10 # but not limited to OpenSSL) that is licensed under separate terms,
11 # as designated in a particular file or component or in included license
12 # documentation. The authors of MySQL hereby grant you an additional
13 # permission to link the program and your derivative works with the
14 # separately licensed software that they have either included with
15 # the program or referenced in the documentation.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License, version 2.0, for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26 # Scripts to run by MySQL Router systemd service
27 #
28 # Needed argument: pre
29 #
30 # pre mode : try to perform sanity check for configuration, log, data
31
32 sanity () {
33 @DEB_INIT_ROUTER_APPARMOR@
34
35 if [ ! -r /etc/mysqlrouter/mysqlrouter.conf ]; then
36 echo "MySQL configuration not found at /etc/mysqlrouter/mysqlrouter.conf."
37 exit 1
38 fi
39 }
40
41 case $1 in
42 "pre") sanity $2 ;;
43 esac