pi-build/patch/test-patch

39 wiersze
904 B
Bash

#!/bin/bash
#This test-patch script should serve as a
#template for future patch scripts.
#20210805 KM4ACK
HEADER(){
clear;echo;echo "====================="
echo "Build a Pi Patch Tool"
echo "====================="
}
#Give this patch a unique name. A good idea is
#to give it the application name that is being
#patched followed by the date. ie FLDIDI20210805
PATCHNAME=test-patch20210805
PATCHFILE=$HOME/.config/patch
touch $PATCHFILE
#check to see if patch already applied
PATCHCHECK=$(grep "$PATCHNAME" $PATCHFILE)
if [ -z $PATCHCHECK ]; then
#if patch hasn't been applied before, apply it now
clear;echo;echo
echo "This is a test patch"
#write patch name to a file so we can
#look and see if it has been applied before.
echo "$PATCHNAME" >> $PATCHFILE
else
#if patch previously applied, notify user and exit
clear;echo;echo
HEADER
echo "$PATCHNAME already applied to this system"
sleep 3
fi