Remove set uo and no capital chars in alias
This commit is contained in:
parent
89ae8b6220
commit
7ac4acd5ef
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
set -uo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
[ -r /var/lib/from_repos/ad_scripts/shared_functions.sh ] && . /var/lib/from_repos/ad_scripts/shared_functions.sh
|
||||
function usage() {
|
||||
|
@ -98,7 +98,7 @@ fi
|
|||
|
||||
while [ "${alias}" == "" ]
|
||||
do
|
||||
random_string=$(LC_ALL=C tr -dc A-Za-z0-9 </dev/urandom | head -c "${alias_length}")
|
||||
random_string=$(LC_ALL=C tr -dc a-z0-9 </dev/urandom | head -c "${alias_length}")
|
||||
existing=$(echo "SELECT source FROM mail.forwardings where source = '${random_string}@${domain}';" |mysql mail |grep -v '^source$')
|
||||
if [ -z "${existing}" ]; then
|
||||
alias="${random_string}@${domain}"
|
||||
|
|
Loading…
Reference in a new issue