Skip to content

A generic automated system upgrade and maintenance script for servers.

License

Notifications You must be signed in to change notification settings

JustinTimperio/auto-patcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generic Auto-Patcher

Codacy grade GitHub
A shell script and systemd service that automatically runs package upgrades, cleans orphaned and cached packages, schedules system reboots, and integrates custom pre and post transaction scripts.

Supported Distro's

  • Debian
  • Ubuntu
  • Centos
  • Fedora
  • OpenSUSE Leap
  • OpenSUSE Tumbleweed
  • Arch
  • Manjaro
  • FreeBSD

Install Auto-Patcher

curl https://raw.githubusercontent.com/JustinTimperio/auto-patcher/master/install.sh | sudo sh

Uninstall Auto-Patcher

sudo /opt/auto-patcher/remove.sh


Config Options

The config file for auto-patcher can be found in /etc/auto-patcher/config

Cleanup

Cleans orhpaned packages and old cached package versions. Can be set to 'true' or 'false':
cleanup='true'

Pre_Transaction

Trigger an event before auto-patcher runs any upgrades or maintenance.

  • Run a custom script:
    pre_transaction='$(./home/user/custom.sh')

  • Run a command directly:
    pre_transaction=$(systemctl stop someunit.service anotherunit.service)

Post_Transaction

Trigger an event after auto-patcher runs an upgrade but before a reboot is scheduled.

  • Run a custom script:
    post_transaction='$(./home/user/custom.sh')

  • Run a command directly:
    post_transaction=$(systemctl start someunit.service anotherunit.service)

Force_Reboot

This forces the system to schedule a reboot after every script completion. Can be set to 'true' or 'false':
force_reboot='false'

Disable_Reboot

Disables reboots even if they are needed. Can be set to 'true' or 'false':
disable_reboot='false'

Reboot_Time

Reboot_time sets when a reboot will be scheduled if it is needed. By default a reboot will only be scheduled if the kernel has be upgraded, or if a running service unit requires a reboot to take effect.

  • Schedules a reboot one minute after completion:
    reboot_time=$(date --date='1 minute' +%H:%M)

  • Set a spesific time for a reboot to occur if it is needed:
    reboot_time='00:00'

About

A generic automated system upgrade and maintenance script for servers.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages