Skip to content

Commit

Permalink
Fix database reset size detection
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyaz committed Jun 21, 2021
1 parent 70de31b commit a35f0c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion connmon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ Generate_LastXResults(){
Reset_DB(){
SIZEAVAIL="$(df -P -k "$SCRIPT_STORAGE_DIR" | awk '{print $4}' | tail -n 1)"
SIZEDB="$(ls -l "$SCRIPT_STORAGE_DIR/connstats.db" | awk '{print $5}')"
if [ "$SIZEDB" -gt "$SIZEAVAIL" ]; then
if [ "$SIZEDB" -gt "$((SIZEAVAIL*1024))" ]; then
Print_Output true "Database size exceeds available space. $(ls -lh "$SCRIPT_STORAGE_DIR/connstats.db" | awk '{print $5}')B is required to create backup." "$ERR"
return 1
else
Expand Down

0 comments on commit a35f0c1

Please sign in to comment.