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>
This commit is contained in:
27
scripts/sync-mqtt-config.ts
Normal file
27
scripts/sync-mqtt-config.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/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();
|
||||
Reference in New Issue
Block a user