I tried using crontab to upgrade packages every time I reboot
@reboot cd /home/toor && (echo "$password" | sudo -S apt-get upgrade)
but when I check sudo apt update after a few minutes there's still packages to be upgraded by which I came to the conclusion this command doesn't work
but this echo "$password" | sudo -S apt-get upgrade
works properly on my terminal,
I can't seem to figure out the error
This might be late but it might be because the @reboot commands start executing at the start of your lock-screen and by that time your wifi might not be connected so try this
put that in a shell script and execute the crontab this might work