Skip to content

Instantly share code, notes, and snippets.

@EmperorPenguin18
Created May 11, 2021 00:31
Show Gist options
  • Save EmperorPenguin18/4b25dbe772f6d4a4dca09373eeaa330b to your computer and use it in GitHub Desktop.
Save EmperorPenguin18/4b25dbe772f6d4a4dca09373eeaa330b to your computer and use it in GitHub Desktop.
Adds my ytrefresh script to cron
#!/bin/sh
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
USER=$(ls /home)
CHANNEL="$(echo $@ | awk -F '/' '{print $NF}')"
echo 0 * * * * $USER /home/$USER/.config/scripts/ytrefresh "$CHANNEL" >> /etc/cron.d/youtube
systemctl restart cronie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment