#!/bin/bash # This is a simple script to compare the currently installed version of samba to the latest stable release # available via the www.samba.org website. If the versions do not match, the script will email you. Schedule # this script via cron to run weekly for best results. # Instructions: # Replace and with sender and recipient emails below (without the brackets). # Prerequisites: # This script requires the mailx package in order to send notification emails. # NOTE: This script was developed on a CentOS 7 64-bit system. It may require modification to work on other # Linux distributions or architectures. cursambaversion=`/usr/local/samba/bin/smbclient -V | awk '{print $2;}'` wget https://www.samba.org newsambaversion=`grep gzipped "index.html" | awk '{print $3;}'` rm -f index.html if [[ "$cursambaversion" != "$newsambaversion" ]] then echo "Samba version $newsambaversion is available" | mail -r -s "Samba update available" fi