Skip to content

Commit 34e8df0

Browse files
authored
Merge pull request hestiacp#4085 from hestiacp/fix/v-change-cron-job
Prevent * from expanding in command
2 parents 273e2ef + 0489db2 commit 34e8df0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bin/v-change-cron-job

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# info: change cron job
33
# options: USER JOB MIN HOUR DAY MONTH WDAY COMMAND
44
#
5-
# example: v-change-cron-job admin 7 * * * * * * /usr/bin/uptime
5+
# example: v-change-cron-job admin 7 * * * * * /usr/bin/uptime
66
#
77
# This function is used for changing existing job. It fully replace job
88
# parameters with new one but with same id.
@@ -54,7 +54,7 @@ time=$(echo "$time_n_date" | cut -f 1 -d \ )
5454
date=$(echo "$time_n_date" | cut -f 2 -d \ )
5555

5656
# Concatenating cron string
57-
command=$(echo $command | sed -e "s/'/%quote%/g")
57+
command=$(echo "$command" | sed -e "s/'/%quote%/g")
5858
str="JOB='$job' MIN='$min' HOUR='$hour' DAY='$day' MONTH='$month' WDAY='$wday'"
5959
str="$str CMD='$command' SUSPENDED='no' TIME='$time' DATE='$date'"
6060

docs/docs/reference/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ change cron job
12701270
**Examples**:
12711271

12721272
```bash
1273-
v-change-cron-job admin 7 * * * * * * /usr/bin/uptime
1273+
v-change-cron-job admin 7 * * * * * /usr/bin/uptime
12741274
```
12751275

12761276
This function is used for changing existing job. It fully replace job

0 commit comments

Comments
 (0)