Skip to content

Commit

Permalink
Added permission check
Browse files Browse the repository at this point in the history
  • Loading branch information
gpunathilell committed Jul 15, 2024
1 parent 7054d3f commit 2bdd332
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions files/scripts/sonic-dpu-mgmt-traffic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ ctrl_dpu_forwarding(){
mgmt_iface=eth0
midplane_iface=bridge-midplane

if [ "$EUID" -ne 0 ]
then
echo "Permission denied: Please run the script with elevated privileges using sudo"
exit 1
fi

if ! ifconfig "$midplane_iface" > /dev/null 2>&1; then
echo "$midplane_iface doesn't exist! Please run on smart switch system"
exit 1
Expand Down

0 comments on commit 2bdd332

Please sign in to comment.