myvesta/upd/add_sudo.sh
2014-09-02 15:48:49 +03:00

14 lines
474 B
Bash
Executable File

#!/bin/bash
if [ ! -e /etc/sudoers.d/admin ]; then
echo "# Created by vesta update-trigger" > /etc/sudoers.d/admin
echo "# $(date)" >> /etc/sudoers.d/admin
echo "admin ALL=(ALL) ALL" >> /etc/sudoers.d/admin
echo "admin ALL=NOPASSWD:/usr/local/vesta/bin/*" >> /etc/sudoers.d/admin
chmod 440 /etc/sudoers.d/admin
if [ -z "$(grep /etc/sudoers.d /etc/sudoers)" ]; then
echo -e "\n#includedir /etc/sudoers.d" >> /etc/sudoers
fi
fi