#!/bin/bash

# this must be run as root

# delete log files older than 75 days
find /var/log/ -type f -name "term_patches_*.log" -mtime +75 -exec rm {} \;

# calc new log file name
logname="/var/log/term_patches_"$(date '+%Y%m%d_%H%M%S')".log"

echo "Patching NCURSES and TERMINFO on "$(date)":" >> $logname 2>&1
cd /root/
   
# we pass the current directory as the location of our patch input files
./patch_ncurses.sh /root >> $logname 2>&1
   
./patch_terminfo.sh >> $logname 2>&1