GithubHelp home page GithubHelp logo

justintimperio / auto-patcher Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 45 KB

A generic automated system upgrade and maintenance script for servers.

License: MIT License

Shell 100.00%
system-upgrade maintenance linux auto-patcher patcher freebsd

auto-patcher's Introduction

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'

auto-patcher's People

Contributors

justintimperio avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.