Skip to content

Instantly share code, notes, and snippets.

@groundcat
Created September 15, 2023 01:50
Show Gist options
  • Save groundcat/e660605bd201829b9e7b08a2dd96047b to your computer and use it in GitHub Desktop.
Save groundcat/e660605bd201829b9e7b08a2dd96047b to your computer and use it in GitHub Desktop.

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 -'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment