fix(cli, systemd): Adjust log formatting for consistent output in CLI and systemd commands
This commit is contained in:
parent
9859a02ea2
commit
459911fe5f
@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-03-26 - 2.6.11 - fix(cli, systemd)
|
||||||
|
Adjust log formatting for consistent output in CLI and systemd commands
|
||||||
|
|
||||||
|
- Fixed spacing issues in service installation and status log messages in the systemd module.
|
||||||
|
- Revised output formatting in the CLI to improve message clarity.
|
||||||
|
|
||||||
## 2025-03-26 - 2.6.10 - fix(daemon)
|
## 2025-03-26 - 2.6.10 - fix(daemon)
|
||||||
Adjust console log box formatting for consistent output in daemon status messages
|
Adjust console log box formatting for consistent output in daemon status messages
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@serve.zone/nupst',
|
name: '@serve.zone/nupst',
|
||||||
version: '2.6.10',
|
version: '2.6.11',
|
||||||
description: 'Node.js UPS Shutdown Tool for SNMP-enabled UPS devices'
|
description: 'Node.js UPS Shutdown Tool for SNMP-enabled UPS devices'
|
||||||
}
|
}
|
||||||
|
@ -919,7 +919,7 @@ Options:
|
|||||||
|
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
// Service is running, restart it
|
// Service is running, restart it
|
||||||
console.log('┌─ Service Update ─────────────────────────┐');
|
console.log('┌─ Service Update ──────────────────────────┐');
|
||||||
console.log('│ Configuration has changed.');
|
console.log('│ Configuration has changed.');
|
||||||
console.log('│ Restarting NUPST service to apply changes...');
|
console.log('│ Restarting NUPST service to apply changes...');
|
||||||
|
|
||||||
@ -939,7 +939,7 @@ Options:
|
|||||||
console.log('│ sudo systemctl restart nupst.service');
|
console.log('│ sudo systemctl restart nupst.service');
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('└──────────────────────────────────────────┘');
|
console.log('└───────────────────────────────────────────┘');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Ignore errors checking service status
|
// Ignore errors checking service status
|
||||||
|
@ -66,7 +66,7 @@ WantedBy=multi-user.target
|
|||||||
|
|
||||||
// Write the service file
|
// Write the service file
|
||||||
await fs.writeFile(this.serviceFilePath, this.serviceTemplate);
|
await fs.writeFile(this.serviceFilePath, this.serviceTemplate);
|
||||||
console.log('┌─ Service Installation ─────────────────────┐');
|
console.log('┌─ Service Installation ──────────────────────┐');
|
||||||
console.log(`│ Service file created at ${this.serviceFilePath}`);
|
console.log(`│ Service file created at ${this.serviceFilePath}`);
|
||||||
|
|
||||||
// Reload systemd daemon
|
// Reload systemd daemon
|
||||||
@ -76,7 +76,7 @@ WantedBy=multi-user.target
|
|||||||
// Enable the service
|
// Enable the service
|
||||||
execSync('systemctl enable nupst.service');
|
execSync('systemctl enable nupst.service');
|
||||||
console.log('│ Service enabled to start on boot');
|
console.log('│ Service enabled to start on boot');
|
||||||
console.log('└──────────────────────────────────────────┘');
|
console.log('└─────────────────────────────────────────────┘');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.message === 'Configuration not found') {
|
if (error.message === 'Configuration not found') {
|
||||||
// Just rethrow the error as the message has already been displayed
|
// Just rethrow the error as the message has already been displayed
|
||||||
@ -97,9 +97,9 @@ WantedBy=multi-user.target
|
|||||||
await this.checkConfigExists();
|
await this.checkConfigExists();
|
||||||
|
|
||||||
execSync('systemctl start nupst.service');
|
execSync('systemctl start nupst.service');
|
||||||
console.log('┌─ Service Status ─────────────────────────┐');
|
console.log('┌─ Service Status ───────────────────────────┐');
|
||||||
console.log('│ NUPST service started successfully');
|
console.log('│ NUPST service started successfully');
|
||||||
console.log('└──────────────────────────────────────────┘');
|
console.log('└────────────────────────────────────────────┘');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.message === 'Configuration not found') {
|
if (error.message === 'Configuration not found') {
|
||||||
// Exit with error code since configuration is required
|
// Exit with error code since configuration is required
|
||||||
|
Loading…
x
Reference in New Issue
Block a user