Skip to content

Commit

Permalink
PterodactylMarket variables may be replaced via -placeholder in Bluep…
Browse files Browse the repository at this point in the history
…rint
  • Loading branch information
prplwtf committed Apr 10, 2023
1 parent 864cd14 commit e7a0813
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions blueprint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VERSION="([(pterodactylmarket_transactionid)])";
VERSION="([(pterodactylmarket_version)])";

cd /var/www/pterodactyl;
if [[ "$@" == *"-php"* ]]; then
Expand Down Expand Up @@ -76,6 +76,23 @@ if [[ $1 != "-bash" ]]; then
fi;
fi;

if [[ $2 == "-placeholder" ]]; then
if [[ $3 == "" ]]; then
echo -e "Expected 2 arguments but got 0. (-placeholder transactionid versionid)";
exit 1;
fi;
if [[ $4 == "" ]]; then
echo -e "Expected 2 arguments but got 1. (-placeholder transactionid versionid)";
exit 1;
fi;

sed -E -i "s*\(\[\(pterodactylmarket_version\)\]\)*$4*g" app/Services/Helpers/BlueprintPlaceholderService.php;
sed -E -i "s*\(\[\(pterodactylmarket_transactionid\)\]\)*$3*g" app/Services/Helpers/BlueprintPlaceholderService.php;

sed -E -i "s*\(\[\(pterodactylmarket_version\)\]\)*$4*g" blueprint.sh;
sed -E -i "s*\(\[\(pterodactylmarket_transactionid\)\]\)*$3*g" blueprint.sh;
fi;

if [[ ( $2 == "-i" ) || ( $2 == "-install" ) ]]; then
if [[ $3 == "" ]]; then error "Expected 1 argument but got 0.";fi;
FILE=$3".blueprint"
Expand Down Expand Up @@ -219,4 +236,4 @@ if [[ $2 == "-reinstall" ]]; then
dbRemove "blueprint.setupFinished";
cd /var/www/pterodactyl;
bash blueprint.sh;
fi;
fi;

0 comments on commit e7a0813

Please sign in to comment.