You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ublinux-init/ublinux/rc.local.d/10-sudoers

22 lines
610 B

#!/bin/bash
ENABLED=yes
[[ ${ENABLED} == "yes" ]] || exit 0
DEBUGMODE=no
ALLOWEDSUDO=ldconfig,ubupdate,ntpdate
PATH=/usr/lib/ublinux/scripts:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:
. /usr/lib/ublinux/functions
. /usr/lib/ublinux/default
SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
debug_mode "$0" "$@"
echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers.d/ubwheel
for a in $(echo $ALLOWEDSUDO | tr ',;' ' ') ;do
b=$(which $a 2>/dev/null)
grep -sq "NOPASSWD: $b" /etc/sudoers.d/ubnopasswd || echo "%users ALL=NOPASSWD: $b" >> /etc/sudoers.d/ubnopasswd
done