Task-scheduler user

I have a script that updates my config if the upstream gateway changes. I know if this script is run under root the config will be locked until a reboot. I know the script needs to be run as a user with sg vyattacfg -c.Looking at /etc/cron.d/vyos-crontab the task looks like this:

Generated by vyos-update-crontab.py

0 4 * * * root sg vyattacfg “/home/vyos/ckgwip_vlan.sh”

Will this task run properly, and not lock the config once it executes? Can the user be changed, do you need the -c ?

Could you please share your script to test in my lab.

see the code here

if [ “$(id -g -n)” != ‘vyattacfg’ ] ; then
exec sg vyattacfg -c “/bin/vbash $(readlink -f $0) $@”
fi

Add this after vbash

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.