peliprint/blueprint/lib/db.sh

21 lines
786 B
Bash
Raw Normal View History

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