diff --git a/libexec/kiwi-cron/create_schedule b/libexec/kiwi-cron/create_schedule index 34ed88c..5a09075 100755 --- a/libexec/kiwi-cron/create_schedule +++ b/libexec/kiwi-cron/create_schedule @@ -4,7 +4,7 @@ cs_every="${1:-1}" cs_units="${2}" cs_command="${3}" -if [ "${cs_every}" -eq 1 ]; then +if [ "${cs_every}" = "1" ]; then cs_every="" else cs_every="/${cs_every}" diff --git a/libexec/kiwi-cron/print_crontab b/libexec/kiwi-cron/print_crontab index a2c6a29..0647be6 100755 --- a/libexec/kiwi-cron/print_crontab +++ b/libexec/kiwi-cron/print_crontab @@ -1,28 +1,16 @@ #!/bin/sh -print_cron_schedule () { - pcs_minute="${1}" - pcs_hour="${2}" - pcs_day="${3}" - pcs_month="${4}" - pcs_weekday="${5}" - pcs_command="${6}" - - printf '%-8s%-8s%-8s%-8s%-8s%s\n' \ - "${pcs_minute}" "${pcs_hour}" "${pcs_day}" "${pcs_month}" "${pcs_weekday}" "${pcs_command}" -} - # header echo '# crontab generated by kiwi-cron' echo '# generation time: '"$(date)" echo '#' # short documentation line -print_cron_schedule \ +printf '%-8s%-8s%-8s%-8s%-8s%s\n' \ "# min" "hour" "day" "month" "weekday" "command" # schedules -while read -r pc_min pc_hour pc_day pc_month pc_weekday pc_command; do - print_cron_schedule \ - "${pc_min}" "${pc_hour}" "${pc_day}" "${pc_month}" "${pc_weekday}" "${pc_command}" +while read -r pc_minute pc_hour pc_day pc_month pc_weekday pc_command; do + printf '%-8s%-8s%-8s%-8s%-8s%s\n' \ + "${pc_minute}" "${pc_hour}" "${pc_day}" "${pc_month}" "${pc_weekday}" "${pc_command}" done