diff --git a/install.sh b/install.sh index 950cdee..3e54497 100755 --- a/install.sh +++ b/install.sh @@ -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/ diff --git a/update.sh b/update.sh index 07c5562..50d8549 100755 --- a/update.sh +++ b/update.sh @@ -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