Skip to content

Instantly share code, notes, and snippets.

@albal
Created July 16, 2018 10:09
Show Gist options
  • Select an option

  • Save albal/047298598e49397db0c05682aafcfae5 to your computer and use it in GitHub Desktop.

Select an option

Save albal/047298598e49397db0c05682aafcfae5 to your computer and use it in GitHub Desktop.
Ubuntu compatible update scripts for Centos
#!/bin/bash
# /usr/lib/update-notifier/apt-check
val=$(yum check-update --quiet | grep '^[a-Z0-9]' | wc -l)
echo "${val};${val}"
#!/bin/bash
# /etc/cron.hourly/needs-reboot.sh
# Install yum-utils : yum install yum-utils
if needs-restarting -r ; then
echo "Does not need restarting"
rm /var/run/reboot-required
else
echo "Needs restarting"
touch /var/run/reboot-required
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment