Added systemd path verification to install script

This commit is contained in:
Donkie
2023-10-22 20:12:23 +02:00
parent 292ecbf166
commit 6e2f2b08f3

View File

@@ -168,6 +168,19 @@ if [ "$choice" == "y" ] || [ "$choice" == "Y" ]; then
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
spoolman_dir=$(dirname "$script_dir")
# Verify that we found the right spoolman dir by checking for the existence of pyproject.toml
if [ ! -f "$spoolman_dir/pyproject.toml" ]; then
echo -e "${ORANGE}Could not automatically find the Spoolman directory. Please specify the path to the Spoolman directory (the directory containing pyproject.toml):${NC}"
read spoolman_dir
# Expand the path
spoolman_dir=$(eval echo "$spoolman_dir")
# Verify again
if [ ! -f "$spoolman_dir/pyproject.toml" ]; then
echo -e "${ORANGE}Could not find pyproject.toml in $spoolman_dir. Aborting installation.${NC}"
exit 1
fi
fi
# Define the systemd service unit file
service_unit="[Unit]
Description=Spoolman