Merge pull request #1824 from dinger1986/dinger1986-added-passwordless-sudo-verify
added passwordless sudo verify for backup scheduling
This commit is contained in:
commit
cecf45a698
|
@ -16,6 +16,11 @@ if [ $EUID -eq 0 ]; then
|
|||
fi
|
||||
|
||||
if [[ $* == *--schedule* ]]; then
|
||||
if ! sudo -n true 2>/dev/null; then
|
||||
echo -ne "${RED}Error: Passwordless sudo is required for scheduling.${NC}\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
(
|
||||
crontab -l 2>/dev/null
|
||||
echo "0 0 * * * /rmm/backup.sh --auto > /dev/null 2>&1"
|
||||
|
|
Loading…
Reference in New Issue