Просмотр исходного кода

Merge pull request #4085 from hestiacp/fix/v-change-cron-job

Prevent * from expanding in command
Jaap Marcus 2 лет назад
Родитель
Сommit
34e8df025c
2 измененных файлов с 3 добавлено и 3 удалено
  1. 2 2
      bin/v-change-cron-job
  2. 1 1
      docs/docs/reference/cli.md

+ 2 - 2
bin/v-change-cron-job

@@ -2,7 +2,7 @@
 # info: change cron job
 # info: change cron job
 # options: USER JOB MIN HOUR DAY MONTH WDAY COMMAND
 # options: USER JOB MIN HOUR DAY MONTH WDAY COMMAND
 #
 #
-# example: v-change-cron-job admin 7 * * * * * * /usr/bin/uptime
+# example: v-change-cron-job admin 7 * * * * * /usr/bin/uptime
 #
 #
 # This function is used for changing existing job. It fully replace job
 # This function is used for changing existing job. It fully replace job
 # parameters with new one but with same id.
 # parameters with new one but with same id.
@@ -54,7 +54,7 @@ time=$(echo "$time_n_date" | cut -f 1 -d \ )
 date=$(echo "$time_n_date" | cut -f 2 -d \ )
 date=$(echo "$time_n_date" | cut -f 2 -d \ )
 
 
 # Concatenating cron string
 # Concatenating cron string
-command=$(echo $command | sed -e "s/'/%quote%/g")
+command=$(echo "$command" | sed -e "s/'/%quote%/g")
 str="JOB='$job' MIN='$min' HOUR='$hour' DAY='$day' MONTH='$month' WDAY='$wday'"
 str="JOB='$job' MIN='$min' HOUR='$hour' DAY='$day' MONTH='$month' WDAY='$wday'"
 str="$str CMD='$command' SUSPENDED='no' TIME='$time' DATE='$date'"
 str="$str CMD='$command' SUSPENDED='no' TIME='$time' DATE='$date'"
 
 

+ 1 - 1
docs/docs/reference/cli.md

@@ -1270,7 +1270,7 @@ change cron job
 **Examples**:
 **Examples**:
 
 
 ```bash
 ```bash
-v-change-cron-job admin 7 * * * * * * /usr/bin/uptime
+v-change-cron-job admin 7 * * * * * /usr/bin/uptime
 ```
 ```
 
 
 This function is used for changing existing job. It fully replace job
 This function is used for changing existing job. It fully replace job