#!/bin/sh # _lldpd needs to be added to users and groups to run. # If group _lldpd does not exist, create it. if ! sudo grep -q "_lldpd" /etc/group; then sudo addgroup _lldpd; fi # If user _lldpd does not exist, create it. if ! sudo grep -q "_lldpd" /etc/passwd; then sudo adduser -H -S -s /bin/sh -G _lldpd -D _lldpd; fi # If _lldpd is not in sudoers, add it. if ! sudo grep -q "_lldpd" /etc/sudoers then echo -e "_lldpd\tALL=NOPASSWD: ALL" | sudo tee -a /etc/sudoers > /dev/null fi