bug6020: fixed check for parameter count in build-crontab-and-cp-files

This commit is contained in:
Axel Uhl
2024-07-17 16:43:58 +02:00
parent 2642779b31
commit c606743d86
2 changed files with 2 additions and 11 deletions
@@ -32,7 +32,7 @@ do
esac
done
shift $((OPTIND-1)) # shift the arguments along so there are no options in the arguments anymore.
if [[ "$#" -ne 3 ]]; then
if [[ "$#" -ne 1 ]]; then
echo "$0 [ -f ] [ -n ] [ -c ] <ENVIRONMENT_TYPE>"
echo ""
echo "Use the f(iles) flag to disable file copying. Use the c(rontab) flag to disable the creation of users and the creation of crontab files for those users."
@@ -69,15 +69,6 @@ clean_servers_dir() {
rm -rf /home/sailing/servers/*
}
#DEPRECATED
update_root_crontab() {
# The following assumes that /root/crontab is a symbolic link to /home/sailing/code/configuration/crontabs/<the crontab appropriate
# to the environment or user>
# which has previously been updated by a git pull:
cd /root
crontab crontab
}
build_crontab_and_setup_files() {
if [[ "$#" -eq 0 ]]; then
echo "Number of arguments is invalid. Please use the options and arguments as follows."
@@ -132,7 +123,7 @@ build_crontab_and_setup_files() {
cd "${TEMP_ENVIRONMENTS_SCRIPTS}"
# Add all args to array, otherwise, if PASS_OPTIONS is empty, and we also pass $@ then argument $1 is in fact null, which would cause errors.
for option in "$@"; do
PASS_OPTIONS+=( "$option")
PASS_OPTIONS+=( "$option" )
done
if ! sudo ./build-crontab-and-cp-files "${PASS_OPTIONS[@]}"; then
return 1