pica/run.sh.in

29 lines
605 B
Bash
Raw Normal View History

2023-12-28 20:26:08 +00:00
#!/bin/bash
2023-12-30 22:42:11 +00:00
#SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
#SPDX-License-Identifier: GPL-3.0-or-later
2023-12-28 20:26:08 +00:00
start_service() {
if (systemctl is-active --quiet $1) then
2023-12-28 20:26:08 +00:00
echo "$1 is already running"
else
2024-01-13 23:57:42 +00:00
echo "$1 is not running, going to use sudo to start it"
if (sudo systemctl start $1) then
echo "$1 started"
else
exit
fi
2023-12-28 20:26:08 +00:00
fi
}
if [ ! -d "/run/pica" ]; then
2024-03-29 21:57:45 +00:00
echo "required unix socket was not found, going to use sudo to create it"
2023-12-28 20:26:08 +00:00
sudo mkdir /run/pica
sudo chown $USER:$USER /run/pica
fi
start_service "mariadb"
start_service "httpd"
2023-12-30 22:42:11 +00:00
./@PROJECT_NAME@