biapy-updater is a Bash script designed to automate keeping tools provided by this site up-to-date. It is a wrapper around wget replacing the checked tool when a newer version is available. This post describe its installation on Debian.

This howto is tested on:

  • Debian 10.0 Buster

This howto is tested with these versions of the software:

  • 1.2.3

Installation

Detect if sudo is available (“command” is used if not):

cmdProxy='command'
command type -f 'sudo' &>'/dev/null' && cmdProxy='sudo'

Install the tool :

${cmdProxy} wget --quiet --no-check-certificate \
    --output-document='/usr/local/bin/biapy-updater' \
    'https://raw.githubusercontent.com/biapy/howto.biapy.com/master/updaters/biapy-updater'

Declare the downloaded file as executable:

${cmdProxy} chmod +x '/usr/local/bin/biapy-updater'

Automatic updates

Setup a cron task for checking daily for versions of installed tools:

${cmdProxy} tee '/etc/cron.d/biapy-updater' \
  <<< "#
# Regular cron jobs for biapy-updater to check for software updates.
# See /etc/biapy-updater.conf
#
# Every night at 6 o'clock.
0 6 * * *   root    test -x /usr/local/bin/biapy-updater && /usr/local/bin/biapy-updater --cron"

Create the cron task configuration file:

test -e '/etc/biapy-updater.conf' \
  || ${cmdProxy} tee '/etc/biapy-updater.conf' \
      <<< "# biapy-updater cron task configuration.
# list tools to update with biapy-updater. One tool per line."

Reload cron daemon configuration:

${cmdProxy} systemctl 'restart' 'cron'

Usage

Display the tool help:

${cmdProxy} biapy-updater --help

Check if a Biapy script is up-to-date with:

${cmdProxy} biapy-updater 'biapy-updater'
${cmdProxy} biapy-updater 'a2tools'
${cmdProxy} biapy-updater 'php-tools'

Check for updates for all scripts listed in “/etc/biapy-updater.conf”:

${cmdProxy} biapy-updater --cron

Categories: Software

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.