Hermes-Secure-Email-Gateway icon indicating copy to clipboard operation
Hermes-Secure-Email-Gateway copied to clipboard

Syntax error in generated script.

Open ScaredyCat opened this issue 1 year ago • 5 comments

Logging into the admin interface I am presented with the following warning box. error

Examining the script, it contains:

#!/bin/bash df -hl | awk '/^\/dev\/mapper/ubuntu--vg-ubuntu--lv/ { sum+=$5 } END { print sum }' Executing script:

awk: cmd. line:1: /^\/dev\/mapper/ubuntu--vg-ubuntu--lv/ { sum+=$5 } END { print sum } awk: cmd. line:1: ^ syntax error It also looks like a new script is generated on each page load/refresh, is this expected behaviour?

ScaredyCat avatar Aug 01 '22 10:08 ScaredyCat

Hi, a new script generated on each page load/refresh is expected behavior. The error is caused by the script not being able to handle LVM devices which unfortunately is the default behavior for Ubuntu during drive setup.

deeztek avatar Aug 01 '22 15:08 deeztek

Issued a patch to fix this issue. Please download the script below and run it as root in your system to update the file in question and it should resolve the issue:

https://raw.githubusercontent.com/deeztek/Hermes-Secure-Email-Gateway/master/patches/c93730b_issue_30.sh

deeztek avatar Aug 01 '22 15:08 deeztek

The patch creates a

get_system_root_filesystem_usage.cfm.1 file due to the existing version. Moving the old file to a backup folder and renaming the .1 the error is still generated, the generated code is still the same (trailing slash) . Is there somehting else that needs to be done after the file is installed? I've restarted . Is the .cfm data cached somewhere?

ScaredyCat avatar Aug 02 '22 09:08 ScaredyCat

Fixed the script to delete the existing file and replace it with the new version. Can you try to run the new patch script:

https://raw.githubusercontent.com/deeztek/Hermes-Secure-Email-Gateway/master/patches/c93730b_issue_30.sh

If you still get the same error, can you share the output of the following command:

df -h

Thanks

deeztek avatar Aug 02 '22 11:08 deeztek

closing issue as fixed. Please re-open if any more problems.

deeztek avatar Aug 05 '22 21:08 deeztek