Fix handling floating traffic limit in add_user.sh

This commit is contained in:
Sarina
2024-07-22 16:55:24 +03:30
parent a637425804
commit 061a85a167

View File

@ -43,7 +43,7 @@ add_user() {
fi fi
# Convert GB to bytes (1 GB = 1073741824 bytes) # Convert GB to bytes (1 GB = 1073741824 bytes)
traffic=$((traffic_gb * 1073741824)) traffic=$(echo "$traffic_gb * 1073741824" | bc)
if [ ! -f "$USERS_FILE" ]; then if [ ! -f "$USERS_FILE" ]; then
echo "{}" > "$USERS_FILE" echo "{}" > "$USERS_FILE"