Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split long lines in domains.txt (revised) #662

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion dehydrated
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,16 @@ command_sign_domains() {
# Generate certificates for all domains found in domains.txt. Check if existing certificate are about to expire
ORIGIFS="${IFS}"
IFS=$'\n'
for line in $(<"${DOMAINS_TXT}" tr -d '\r' | awk '{print tolower($0)}' | _sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' -e 's/[[:space:]]+/ /g' -e 's/([^ ])>/\1 >/g' -e 's/> />/g' | (grep -vE '^(#|$)' || true)); do
line=''
for part in $(<"${DOMAINS_TXT}" tr -d '\r' | awk '{print tolower($0)}' | _sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' -e 's/[[:space:]]+/ /g' -e 's/([^ ])>/\1 >/g' -e 's/> />/g' -e 's/[[:space:]]+\\/\\/'); do
if [[ "${part: -1}" == '\' ]]; then
[[ "${part:0:1}" != '#' ]] && line="${line} ${part:0:-1}"
continue
elif [[ "${part:0:1}" != '#' ]]; then
line="${line} ${part}"
fi
[[ -z "${line//[[:space:]]/}" ]] && continue
line="${line:1}"
reset_configvars
IFS="${ORIGIFS}"
alias="$(grep -Eo '>[^ ]+' <<< "${line}" || true)"
Expand All @@ -1206,6 +1215,7 @@ command_sign_domains() {
domain="$(printf '%s\n' "${line}" | cut -d' ' -f1)"
morenames="$(printf '%s\n' "${line}" | cut -s -d' ' -f2-)"
[ ${aliascount} -lt 1 ] && alias="${domain}" || alias="${alias#>}"
line=''
export alias

if [[ -z "${morenames}" ]];then
Expand Down