mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
Fixed shellcheck issue SC2015: Note that A && B || C is not if-then-else. C may run when A is true.
Replaced [ $1 -gt 1 ] && shift $1 || shift with shift $1 since shift 1 is identical to shift.
This commit is contained in:
parent
48052e2f24
commit
8aa4607e5e
2 changed files with 2 additions and 2 deletions
|
@ -1810,7 +1810,7 @@ askEncryption(){
|
|||
cidrToMask(){
|
||||
# Source: https://stackoverflow.com/a/20767392
|
||||
set -- $(( 5 - ($1 / 8) )) 255 255 255 255 $(( (255 << (8 - ($1 % 8))) & 255 )) 0 0 0
|
||||
[ $1 -gt 1 ] && shift $1 || shift
|
||||
shift $1
|
||||
echo ${1-0}.${2-0}.${3-0}.${4-0}
|
||||
}
|
||||
|
||||
|
|
|
@ -422,7 +422,7 @@ fi
|
|||
cidrToMask(){
|
||||
# Source: https://stackoverflow.com/a/20767392
|
||||
set -- $(( 5 - ($1 / 8) )) 255 255 255 255 $(( (255 << (8 - ($1 % 8))) & 255 )) 0 0 0
|
||||
[ $1 -gt 1 ] && shift $1 || shift
|
||||
shift $1
|
||||
echo ${1-0}.${2-0}.${3-0}.${4-0}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue