Files
location-mqtt-tracker-app/scripts/sync-mqtt-config.ts
Joachim Hummel b95866f549 Fix MQTT password sync to actually update password.txt
- Add scripts/sync-mqtt-config.ts for standalone sync execution
- Update change-mqtt-admin-password.sh to use tsx to execute sync
- Now properly regenerates password.txt with new hashed password
- Mosquitto config is automatically reloaded after sync

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 08:19:25 +00:00

28 lines
666 B
JavaScript

#!/usr/bin/env node
/**
* Standalone script to sync MQTT configuration
* This can be run directly without authentication
*/
import { syncMosquittoConfig } from '../lib/mosquitto-sync';
async function main() {
try {
console.log('Starting MQTT configuration sync...');
const result = await syncMosquittoConfig();
if (result.success) {
console.log('✓ Success:', result.message);
process.exit(0);
} else {
console.error('✗ Failed:', result.message);
process.exit(1);
}
} catch (error) {
console.error('✗ Error:', error instanceof Error ? error.message : String(error));
process.exit(1);
}
}
main();