• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

pfsense wan up down shell sh

NAT
1
1
205
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H
    heartk
    last edited by Jan 1, 2024, 12:55 PM

    #!/bin/bash
    pfctl -si > /etc/si.log
    percentage=$(grep "current entries" /etc/si.log | awk '{print $NF}')
    total=100
    threshold=70
    result=$(echo "scale=4; $percentage * $total / 801000" | bc)
    result_int=$(echo $result | cut -d'.' -f1)
    if [ $result_int -ge $threshold ]; then
    sudo ifconfig igb0 down
    echo "Current usage is $result%. Taking action..."
    else
    echo "Current usage is $result%. No action needed."
    fi

    26: Syntax error: end of file unexpected (expecting "then")
    An error occurs. Can you tell me where the problem occurred?

    1 Reply Last reply Reply Quote 0
    1 out of 1
    • First post
      1/1
      Last post
    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.