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

    pfsense wan up down shell sh

    Scheduled Pinned Locked Moved NAT
    1 Posts 1 Posters 233 Views
    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

      #!/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
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.