From 93886c460cb1e7d7fc2e0f2cf3d6f7b39b4591a8 Mon Sep 17 00:00:00 2001 From: Tim Ferrell Date: Mon, 22 May 2023 22:52:06 -0400 Subject: [PATCH] Remove hardcoded paths from setup --- setup/setup.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setup/setup.sh b/setup/setup.sh index 28aec15..22f1178 100755 --- a/setup/setup.sh +++ b/setup/setup.sh @@ -1,10 +1,13 @@ #!/bin/bash +parent_path=$(cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P) +pushd "$parent_path" echo "Setting up pool-pi." echo "Installing required python packages." -pip3 install -r /home/pi/Pool-Pi/setup/requirements.txt +pip3 install -r "$parent_path/requirements.txt" echo "Configuring systemd." -cp /home/pi/Pool-Pi/setup/poolpi.service /etc/systemd/system/poolpi.service +cp "$parent_path/poolpi.service" /etc/systemd/system/poolpi.service chmod 644 /etc/systemd/system/poolpi.service systemctl daemon-reload systemctl enable --now poolpi.service -echo "Setup script complete." \ No newline at end of file +echo "Setup script complete" +popd