pica/run.sh.in

29 lines
619 B
Bash

#!/bin/bash
#SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
#SPDX-License-Identifier: GPL-3.0-or-later
start_service() {
if (systemctl is-active --quiet $1) then
echo "$1 is already running"
else
echo "$1 is not running, going to use sudo to start it"
if (sudo systemctl start $1) then
echo "$1 started"
else
exit
fi
fi
}
if [ ! -d "/run/pica" ]; then
echo "required unix socket was not found, going to use sudo to create it"
sudo mkdir /run/pica
sudo chown $USER:$USER /run/pica
fi
start_service "mariadb"
start_service "httpd"
$(dirname "$0")/@PROJECT_NAME@