- 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>
28 lines
666 B
JavaScript
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();
|