Draft: ppp-udeb.postinst: Rework hostname code
Refine echo replacement with printf (fixes commit c1c728fa)
- Add missing trailing new line in format string
- Move variable substitution out of format string
- replace more
echowithprintf
Rework valid_hostname()
-
Replace non-portable 'echo' with 'printf'
-
Fix regex to not allow backslash
-
Do not allow hyphens or dots at the beginning or the end of the hostname
-
Do not allow hyphens at the beginning or the end of a label
-
Add new function
valid_domain()and reject invalid domain. -
Change
valid_hostname()to allow only short hostname (no dots).
Edited by Pascal Hambourg