#!/bin/bash
# RETIRED 2026-08-21: this inserted TEST-* bandwidth/plan rows with enabled=1,
# which showed up to real customers as real, payable bundles on the captive
# portal. Use the router's "trial_on" toggle (admin > Mes tarifs > Essai
# gratuit) to test the hotspot/portal instead - it configures the MikroTik
# hotspot server profile directly and never creates a customer-facing plan.
exit 1

set -e
mysql phpnuxbill -e "DESCRIBE tbl_bandwidth;"
mysql phpnuxbill -e "DESCRIBE tbl_plans;"
mysql phpnuxbill <<'SQL'
INSERT INTO tbl_bandwidth (name_bw, rate_down, rate_down_unit, rate_up, rate_up_unit)
SELECT 'TEST-1H', '2', 'Mbps', '2', 'Mbps' FROM DUAL
WHERE NOT EXISTS (SELECT 1 FROM tbl_bandwidth WHERE name_bw='TEST-1H');
INSERT INTO tbl_bandwidth (name_bw, rate_down, rate_down_unit, rate_up, rate_up_unit)
SELECT 'TEST-1J', '4', 'Mbps', '4', 'Mbps' FROM DUAL
WHERE NOT EXISTS (SELECT 1 FROM tbl_bandwidth WHERE name_bw='TEST-1J');
INSERT INTO tbl_bandwidth (name_bw, rate_down, rate_down_unit, rate_up, rate_up_unit)
SELECT 'TEST-5GO', '5', 'Mbps', '5', 'Mbps' FROM DUAL
WHERE NOT EXISTS (SELECT 1 FROM tbl_bandwidth WHERE name_bw='TEST-5GO');
SQL
mysql phpnuxbill -e "SELECT id, name_bw FROM tbl_bandwidth;"
