2023-03-03 10:52:29 -05:00
#!/bin/bash
err = "\033[0;31m ERROR \033[0m" ;
warn = "\033[0;33m WARN \033[0m" ;
info = "\033[0;96m INFO \033[0m" ;
task = "\033[0;93m TASK \033[0m" ;
2023-03-06 13:11:53 -05:00
cd /var/www/pterodactyl;
2023-03-08 04:44:53 -05:00
if [ [ " $@ " != *"-php" * ] ] ; then
exit 1;
fi ;
2023-03-06 13:11:53 -05:00
mkdir -p .blueprint > /dev/null;
2023-03-03 10:52:29 -05:00
dbAdd( ) {
# dbAdd "database.record";
sed -i " s/+ db.addnewrecord;/* ${ 1 } ;\n+ db.addnewrecord;/g " /var/www/pterodactyl/.blueprint/db.md;
} ; dbValidate( ) {
# dbValidate "database.record";
grep -Fxq " * ${ 1 } ; " /var/www/pterodactyl/.blueprint/db.md;
} ; dbRemove( ) {
# dbRemove "database.record";
sed -i " s/* ${ 1 } ;//g " /var/www/pterodactyl/.blueprint/db.md;
} ;
touch /usr/local/bin/blueprint > /dev/null;
echo -e "#!/bin/bash\nbash /var/www/pterodactyl/blueprint.sh \$@ -bash;" > /usr/local/bin/blueprint;
chmod u+x /var/www/pterodactyl/blueprint.sh > /dev/null;
chmod u+x /usr/local/bin/blueprint > /dev/null;
if [ [ " $@ " != *"-bash" * ] ] ; then
if dbValidate "blueprint.setupFinished" ; then
echo -e $info "\033[0;34mThis command only works if you have yet to install Blueprint. You can run \"\033[1;94mblueprint\033[0m\033[0;34m\" instead.\033[0m" ;
2023-03-03 11:00:03 -05:00
dbRemove "blueprint.setupFinished" ;
2023-03-03 10:52:29 -05:00
else
2023-03-08 12:35:54 -05:00
echo -e $info "\033[0;34m/var/www/pterodactyl/.blueprint/db.md\033[0m" ;
2023-03-03 10:52:29 -05:00
touch .blueprint/db.md > /dev/null;
echo -e "# Internal database for the bash side of Blueprint.\n+ db.addnewrecord;" > .blueprint/db.md;
2023-03-06 13:11:53 -05:00
2023-03-08 12:35:54 -05:00
echo -e $info "\033[0;34m/var/www/pterodactyl/public/themes/pterodactyl/css/pterodactyl.css\033[0m" ;
2023-03-06 13:11:53 -05:00
sed -i "s/@import 'checkbox.css';/@import 'checkbox.css';\n@import url(/assets/extensions/blueprint/blueprint.style.css);/g" /var/www/pterodactyl/public/themes/pterodactyl/css/pterodactyl.css;
2023-03-08 12:35:54 -05:00
echo -e $info "\033[0;34mphp artisan view:clear\033[0m" ;
2023-03-06 13:11:53 -05:00
php artisan view:clear > /dev/null;
2023-03-08 12:35:54 -05:00
echo -e $info "\033[0;34mphp artisan config:clear\033[0m" ;
2023-03-06 13:11:53 -05:00
php artisan config:clear > /dev/null;
2023-03-08 12:35:54 -05:00
echo -e $info "\033[0;34mchown -R www-data:www-data /var/www/pterodactyl/*\033[0m" ;
2023-03-06 13:11:53 -05:00
chown -R www-data:www-data /var/www/pterodactyl/* > /dev/null;
2023-03-03 11:00:03 -05:00
dbAdd "blueprint.setupFinished" ;
2023-03-03 10:52:29 -05:00
fi ;
fi ;