add sbin to install and update

This commit is contained in:
Matthew Saunders Brown 2022-07-19 13:27:19 -07:00
parent 461ce697b3
commit e300369ab0
2 changed files with 19 additions and 0 deletions

View File

@ -217,4 +217,6 @@ cp mini_sendmail.8.gz /usr/local/share/man/man8
# install vhost scripts
chmod 755 bin/*
cp bin/* /usr/local/bin/
chmod 755 sbin/*
cp sbin/* /usr/local/sbin/

View File

@ -25,6 +25,23 @@ for bin_script in "${bin_script_array[@]}"; do
fi
done
# update scripts in bin
chmod 755 sbin/*
readarray -t sbin_script_array < <(ls -1 sbin/)
for sbin_script in "${sbin_script_array[@]}"; do
if [ -f /usr/local/sbin/$sbin_script ]; then
if ! diff -q sbin/$sbin_script /usr/local/sbin/$sbin_script ; then
echo "Updating /usr/local/sbin/$sbin_script"
cp sbin/$sbin_script /usr/local/sbin/$sbin_script
echo
fi
else
echo "Adding new script /usr/local/sbin/$sbin_script"
cp sbin/$sbin_script /usr/local/sbin/$sbin_script
echo
fi
done
# check etc configs for diffs
readarray -t etc_configs_array < <(find etc/ -type f)
for etc_config in "${etc_configs_array[@]}"; do