From b797d567e4cecc9a05ee279e06e24a6f1242cbe5 Mon Sep 17 00:00:00 2001
From: Pascal Zarrad
Date: Sun, 1 Aug 2021 22:20:01 +0200
Subject: [PATCH] Fix version printing
---
software/cassandra/entrypoint.sh | 36 ++++++++++++++++++++++++++------
1 file changed, 30 insertions(+), 6 deletions(-)
diff --git a/software/cassandra/entrypoint.sh b/software/cassandra/entrypoint.sh
index 949fc72..4dcf22f 100644
--- a/software/cassandra/entrypoint.sh
+++ b/software/cassandra/entrypoint.sh
@@ -1,5 +1,27 @@
#!/bin/ash
+#
+# Copyright (c) 2021 Matthew Penner
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+
# Default the TZ environment variable to UTC.
TZ=${TZ:-UTC}
export TZ
@@ -11,13 +33,15 @@ export INTERNAL_IP
# Switch to the container's working directory
cd /home/container || exit 1
-# Print Java version
-printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mjava -version\n"
-java -version
-
# Print Python version
-printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mpython --version\n"
-python --version
+if command -v python &> /dev/null
+then
+ printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mpython --version\n"
+ python --version
+else
+ printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mpython3 --version\n"
+ python3 --version
+fi
# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell
# variable format of "${VARIABLE}" before evaluating the string and automatically