mirror of
https://github.com/m8tin/cis.git
synced 2026-08-01 11:47:31 +02:00
Use of base.set() parameter optional and remove exit 1, because is is obsolete.
This commit is contained in:
@@ -50,7 +50,7 @@ function setup() {
|
||||
|
||||
|
||||
|
||||
base.set COMPOSITION "${1}" '^([a-zA-Z0-9][a-zA-Z0-9_-]*)?$' || exit 1
|
||||
base.set COMPOSITION "${1}" '^[a-zA-Z0-9][a-zA-Z0-9_-]*$' optional
|
||||
setup "${COMPOSITION}"
|
||||
|
||||
|
||||
|
||||
@@ -130,11 +130,11 @@ function send() {
|
||||
# Parameter 3: Only alphanumeric characters allowed and [.-] if not leading (due to: -oProxyCommand=...).
|
||||
# Parameter 4: Only alphanumeric characters allowed and [._:-] if not leading (due to: -oProxyCommand=...), but can be empty.
|
||||
# Parameter 5: Only alphanumeric characters allowed and [._:-] if not leading (due to: -oProxyCommand=...), but can be empty.
|
||||
base.set RECEIVERHOST "${1}" '^[a-zA-Z0-9][a-zA-Z0-9._-]*$' || exit 1
|
||||
base.set ZFS_BRANCH "${2}" '^[a-zA-Z][a-zA-Z0-9/_-]*[a-zA-Z0-9]$' || exit 1
|
||||
base.set COMPOSITION "${3}" '^[a-zA-Z0-9][a-zA-Z0-9.-]*$' || exit 1
|
||||
base.set RECEIVERS_SNAPSHOT "${4}" '(^[a-zA-Z0-9][a-zA-Z0-9._:-]*$)?' || exit 1
|
||||
base.set RESUME_TOKEN "${5}" '(^[a-zA-Z0-9][a-zA-Z0-9._:-]*$)?' || exit 1
|
||||
base.set RECEIVERHOST "${1}" '^[a-zA-Z0-9][a-zA-Z0-9._-]*$'
|
||||
base.set ZFS_BRANCH "${2}" '^[a-zA-Z][a-zA-Z0-9/_-]*[a-zA-Z0-9]$'
|
||||
base.set COMPOSITION "${3}" '^[a-zA-Z0-9][a-zA-Z0-9.-]*$'
|
||||
base.set RECEIVERS_SNAPSHOT "${4}" '^[a-zA-Z0-9][a-zA-Z0-9._:-]*$' optional
|
||||
base.set RESUME_TOKEN "${5}" '^[a-zA-Z0-9][a-zA-Z0-9._:-]*$' optional
|
||||
|
||||
# Resume mode
|
||||
if [ "${RECEIVERS_SNAPSHOT}" == "RESUME" ]; then
|
||||
|
||||
@@ -223,8 +223,8 @@ function usage() {
|
||||
|
||||
|
||||
|
||||
# Parameter 2: is optional '()?' and only a subset of alphanumeric characters are allowed and [_-] if not leading (due to: -oProxyCommand=...).
|
||||
base.set COMPOSITION "${2}" '^([a-zA-Z0-9][a-zA-Z0-9_-]*)?$'
|
||||
# Parameter 2: only a subset of alphanumeric characters are allowed and [_-] if not leading (due to: -oProxyCommand=...).
|
||||
base.set COMPOSITION "${2}" '^[a-zA-Z0-9][a-zA-Z0-9_-]*$' optional
|
||||
|
||||
case "${1}" in
|
||||
--onceAll)
|
||||
|
||||
@@ -136,7 +136,7 @@ function snapshot() {
|
||||
|
||||
|
||||
# Parameter 1: Only one of these values (MINUTELY, HOURLY, DAILY, MONTHLY, NONE) are allowed, or empty.
|
||||
base.set MODE "${1}" '^(MINUTELY|HOURLY|DAILY|MONTHLY|NONE)?$' || exit 1
|
||||
base.set MODE "${1}" '^(MINUTELY|HOURLY|DAILY|MONTHLY|NONE)$' optional
|
||||
|
||||
snapshot "${MODE}"
|
||||
cleanup
|
||||
|
||||
Reference in New Issue
Block a user