A one-line command that creates the script in the /opt
directory and sets up the cronjob to run at 2:10 AM:
sudo bash -c 'echo -e "#!/bin/bash\nsudo apt-get update\nsudo apt-get install --only-upgrade tailscale -y" > /opt/update_tailscale.sh && chmod +x /opt/update_tailscale.sh && (crontab -l 2>/dev/null; echo "10 2 * * * /opt/update_tailscale.sh") | crontab -'