X-Git-Url: https://git.plutz.net/?p=httpchat;a=blobdiff_plain;f=channel.sh;h=f8c97a43ae1622f627f518d52a9df40c6d0e5f3f;hp=a59a5a46ddced0c0b7e1daa8559eea04f25f0cd2;hb=HEAD;hpb=ecef5d8df4714fb141e42842e6df2028b151e831 diff --git a/channel.sh b/channel.sh index a59a5a4..f8c97a4 100755 --- a/channel.sh +++ b/channel.sh @@ -43,19 +43,20 @@ nicklist(){ nicklist='NICKNAMES: ' while read -r s p nick; do - [ -d "/proc/$pid" ] && nicklist="${nicklist}/$nick/" \ + [ -d "/proc/$p" ] && nicklist="${nicklist}/$nick/" \ || sed -i -E "/^$s $p /d" "$nickfile" done <"$nickfile" - if ! tail -n20 "$chatfile" |grep -qxF "$nicklist"; then + if ! tail -n20 "$chatfile" |tac |grep -m1 '^NICKNAMES: ' |grep -qxF "$nicklist"; then printf '%s\n' "$nicklist" >>"$chatfile" fi } if [ ! -f "$chatfile" ]; then yield_page create <<-EOF + [h1 No such Channel] [form #nonexist method="POST" There is no channel named $(HTML "$LOCATION") - [submit "action" "create" Create] + [submit "action" "create" Set Up] ] EOF else