changes
This commit is contained in:
@@ -15,16 +15,20 @@ if [[ -z "$UUID" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! "$UUID" =~ ^[0-9a-fA-F-]+$ ]]; then
|
||||
echo "ERROR: Invalid UUID format: $UUID"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
DOMAIN_FILE="/4server/data/$UUID/etc/domain"
|
||||
DB_FILE="/4server/data/contracts.db"
|
||||
if [ -f "$DOMAIN_FILE" ]; then
|
||||
DOMAINS=$(paste -sd "," "$DOMAIN_FILE")
|
||||
sqlite3 "$DB_FILE" <<SQL
|
||||
UPDATE containers
|
||||
SET domains='$DOMAINS'
|
||||
WHERE UUID='$UUID';
|
||||
SQL
|
||||
# Escape single quotes for SQLite ('' is the standard SQLite escape for ')
|
||||
DOMAINS_SAFE="${DOMAINS//\'/\'\'}"
|
||||
UUID_SAFE="${UUID//\'/\'\'}"
|
||||
sqlite3 "$DB_FILE" "UPDATE containers SET domains='$DOMAINS_SAFE' WHERE UUID='$UUID_SAFE';"
|
||||
fi
|
||||
|
||||
|
||||
@@ -59,4 +63,3 @@ case "$SECOND_PART" in
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user