lnaddr.sh (456B)
1 #!/bin/sh 2 username="${PATH_INFO#/}" 3 ok=$(while read -r user; do 4 if [ "$user" = "$username" ]; then 5 echo "1" 6 break 7 fi 8 done < /ln/lnusers.txt) 9 10 if [ -n "$ok" ]; then 11 printf "Content-Type: application/json\r\n" 12 printf "\r\n" 13 ftp -o - "https://coinos.io/.well-known/lnurlp/${username}" | \ 14 sed 's|@coinos\.io|@dalliard.ch|g' 15 else 16 printf "Status: 404 Not Found\r\n" 17 printf "Conten-Type: text/plain\r\n" 18 printf "\r\n" 19 printf "user not found\n" 20 fi