Skip to content

Instantly share code, notes, and snippets.

View yeled's full-sized avatar

Charlie Allom yeled

  • London
View GitHub Profile
@yeled
yeled / portAutoDescription.py
Created September 4, 2017 16:28 — forked from markberly/portAutoDescription.py
Port auto-description tool automatically updates the port description of an interface based on the lldp neighbor information of the attached device. Utilizes Arista EOS eAPI.
#!/usr/bin/python
#
# Copyright (c) 2013, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#!/usr/bin/env bash
COMMAND_NAME=`basename $0`
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PATH="$(echo $PATH | sed s#`echo $DIR | sed 's#\\/#\\\\\\/#g'`:##g)"
COMMAND="$(which $COMMAND_NAME)"
if command -v urxvt > /dev/null 2>&1; then
urxvt -name $COMMAND_NAME -e $COMMAND "$@" & disown -h
else
$COMMAND "$@"
fi