about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCharadon <dev@iotib.net>2022-09-30 11:51:38 -0400
committerCharadon <dev@iotib.net>2022-09-30 11:51:38 -0400
commit1f4f598cfe134c8fc8bed958c22c0de9416906eb (patch)
treebea8116a644a54019c7a9714010f593e95361a43
parent083aae2d4e69d1b1dc1a6dcde3f82a413e5da2b2 (diff)
downloaddscip-1f4f598cfe134c8fc8bed958c22c0de9416906eb.tar.gz
setup.sh: Fixed issue where files weren't copied/symlink'd correctly, and fixed wrong generated crontab entry
-rwxr-xr-xsetup.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/setup.sh b/setup.sh
index 5555020..4c3f75c 100755
--- a/setup.sh
+++ b/setup.sh
@@ -90,20 +90,21 @@ install_dscip() {
 	echo "Installing dscip..."
 	set -x
 	mkdir -p "$PROJECT_LOCATION"
+	PROJECT_LOCATION="$($REALPATH "$PROJECT_LOCATION")"
 	cd "$PROJECT_LOCATION" || return 1
 	if [ -d "/usr/share/charadon/dscip" ]; # See if dscip is packaged/installed on system.
 	then
 		DSCIP_PATH="/usr/share/charadon/dscip"
-		ln -s "$DSCIP_PATH"/dscip "$PROJECT_LOCATION" || \
-			cp "$DSCIP_PATH"/dscip "$PROJECT_LOCATION"
-		install -m755 "$DSCIP_PATH"/config.sh "$PROJECT_LOCATION"
+		ln -s "$DSCIP_PATH"/dscip "$PROJECT_LOCATION"/dscip || \
+			cp "$DSCIP_PATH"/dscip "$PROJECT_LOCATION"/dscip
+		install -m755 "$DSCIP_PATH"/config.sh "$PROJECT_LOCATION"/config.sh
 		install_templates || cp "$DSCIP_PATH"/*.sh .
 	elif [ -d /usr/local/share/charadon/dscip ];
 	then
 		DSCIP_PATH="/usr/local/share/charadon/dscip"
-		ln -s "$DSCIP_PATH"/dscip "$PROJECT_LOCATION" || \
-			cp "$DSCIP_PATH"/dscip "$PROJECT_LOCATION"
-		install -m755 "$DSCIP_PATH"/config.sh "$PROJECT_LOCATION"
+		ln -s "$DSCIP_PATH"/dscip "$PROJECT_LOCATION"/dscip || \
+			cp "$DSCIP_PATH"/dscip "$PROJECT_LOCATION"/dscip
+		install -m755 "$DSCIP_PATH"/config.sh "$PROJECT_LOCATION"/config.sh
 		install_templates || cp "$DSCIP_PATH"/*.sh .
 	else # If not, clone it from upstream.
         if [ -z "$DSCIP_VERSION" ];
@@ -122,7 +123,7 @@ install_dscip() {
 	set +x
 	printf "\n"
 	printf "\e[32mAll done. Be sure to add:\e[0m\n" 
-	echo "* * * * * $($REALPATH ./dscip)"
+	echo "* * * * * $($REALPATH .)/dscip"
 	printf "\e[32mTo your crontab! Usually by using \`crontab -e\`\e[0m\n\n"
 	printf "\e[32mAlternatively, you can run dscip as a daemon by modifying DSCIP_DAEMON in config.sh\n"
 	printf "and creating a daemon for your system's init system.\e[0m\n\n"