2023-03-19 16:00:37 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-05-09 12:06:44 -04:00
|
|
|
FLDR="/var/www/&bp.folder&/.blueprint/.storage/db.md";
|
2023-05-09 11:59:12 -04:00
|
|
|
|
|
|
|
# If Blueprint does not replace the variable, default to "/var/www/pterodactyl" as root folder.
|
2023-05-09 14:37:25 -04:00
|
|
|
if [[ $FLDR == "/var/www/&b""p.folder&/.blueprint/.storage/db.md" ]]; then FLDR="/var/www/pterodactyl/.blueprint/.storage/db.md"; fi;
|
2023-05-09 11:59:12 -04:00
|
|
|
|
2023-03-19 16:00:37 -04:00
|
|
|
dbAdd() {
|
|
|
|
# dbAdd "database.record";
|
2023-05-09 12:06:44 -04:00
|
|
|
sed -i "s/+ db.addnewrecord;/* ${1};\n+ db.addnewrecord;/g" $FLDR > /dev/null;
|
2023-04-02 20:51:44 -04:00
|
|
|
}; dbValidate() {
|
2023-03-19 16:00:37 -04:00
|
|
|
# dbValidate "database.record";
|
2023-05-09 12:06:44 -04:00
|
|
|
grep -Fxq "* ${1};" $FLDR > /dev/null;
|
2023-04-02 20:51:44 -04:00
|
|
|
}; dbRemove() {
|
2023-03-19 16:00:37 -04:00
|
|
|
# dbRemove "database.record";
|
2023-05-09 12:06:44 -04:00
|
|
|
sed -i "s/* ${1};//g" $FLDR > /dev/null;
|
2023-04-02 20:51:44 -04:00
|
|
|
};
|