mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-16 02:38:44 +00:00
bug6020: fixed check for parameter count in build-crontab-and-cp-files
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user