peliprint/blueprint/lib/db.sh
2023-06-17 13:24:35 +02:00

20 lines
753 B
Bash

#!/bin/bash
#
# This script has been created as part of the Blueprint source code
# and may be intergrated directly into the core in the future.
FLDR="/var/www/&bp.folder&/.blueprint/.storage/db.md";
# If Blueprint does not replace the variable, default to "/var/www/pterodactyl" as root folder.
if [[ $FLDR == "/var/www/&b""p.folder&/.blueprint/.storage/db.md" ]]; then FLDR="/var/www/pterodactyl/.blueprint/.storage/db.md"; fi;
dbAdd() {
# dbAdd "database.record";
sed -i "s/+ db.addnewrecord;/* ${1};\n+ db.addnewrecord;/g" $FLDR > /dev/null;
}; dbValidate() {
# dbValidate "database.record";
grep -Fxq "* ${1};" $FLDR > /dev/null;
}; dbRemove() {
# dbRemove "database.record";
sed -i "s/* ${1};//g" $FLDR > /dev/null;
};