allow periods in ship names and titles

This commit is contained in:
James Tomasino 2018-12-30 00:51:14 -05:00
parent f3545a4097
commit e7b2d20097
2 changed files with 2 additions and 2 deletions

View File

@ -133,7 +133,7 @@ check_log () {
printf "\\n Title for message %s? " "$(basename "$u" | sed 's/\.[^.]*$//')"
read -r title
if [ ! -z "$title" ]; then
if printf "%s" "$title" | grep -Eq "^[A-Za-z0-9]+[A-Za-z0-9\\ \\-]*$"; then
if printf "%s" "$title" | grep -Eq "^[A-Za-z0-9]+[A-Za-z0-9\\.\\ \\-]*$"; then
printf "0%s - %s\\t%s\\n" "$ship" "$title" "$u" | cat - /var/gopher/listing.gophermap > "$tmp" && cat "$tmp" > /var/gopher/listing.gophermap && rm "$tmp"
printf "\\n %s - %s .... Sent.\\n" "$(basename "$u" | sed 's/\.[^.]*$//')" "$title"
else

View File

@ -4,7 +4,7 @@ run_user=$(id -u)
if [ "$run_user" -eq 0 ]; then
n="$1"
s="$2"
if printf "%s" "$2" | grep -Eq "^[A-Za-z0-9]+[A-Za-z0-9\\ \\-]*$"; then
if printf "%s" "$2" | grep -Eq "^[A-Za-z0-9]+[A-Za-z0-9\\.\\ \\-]*$"; then
if [ ! -z "$n" ]; then
user_exists=$(id -u "${n}" 2> /dev/null)
if [ ! -z "${user_exists}" ]; then