]> git.netwichtig.de Git - user/henk/code/shell/rif.git/commitdiff
Add invite friend script
authorNico Schottelius <nico@nico-notebook.schottelius.org>
Mon, 9 Sep 2019 17:47:44 +0000 (02:47 +0900)
committerNico Schottelius <nico@nico-notebook.schottelius.org>
Mon, 9 Sep 2019 17:47:44 +0000 (02:47 +0900)
README.md
rif-invitefriend.sh [new file with mode: 0755]

index 7b1f35944df4e4d76181d236dc6b3640714ca85c..40036d81e721aa53076ccc6d009ded2af401c12f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -31,6 +31,7 @@ To become a real IPv6 friend, you need to do the following things:
 - For each of your friends, check whether they are online
 - Import the friends of your friends and check whether they are
   online, too!
+- Send friend requests (like other platforms!)
 
 ### Example: Generating a key with the right comment
 
@@ -196,6 +197,17 @@ automates this process.
 You can probably just use your mail program for that - and you might
 even be able to send it IPv6 only!
 
+### Example: Invite a friend
+
+Live is not great without friends! Let's invite a friend! This is as
+easy is this:
+
+```
+printf 'Hello yournamehere!\n I am looking for real IPv6 friends.\n You find my friends on https://nico.ungleich.cloud/rifkeys.\nHow real IPv6 friends find each other is explained on https://code.ungleich.ch/nico/rif.\n Looking forward to befriend you!' | mail -s "friend request" ipv6@your.friend.example.com
+```
+
+And obviously this is waaaaaaaaay to long to type, so
+
 ## Finding friends
 
 As real IPv6 friends are decentralised, there is no central registry
diff --git a/rif-invitefriend.sh b/rif-invitefriend.sh
new file mode 100755 (executable)
index 0000000..6c63010
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+# 2019-09-10, Nico Schottelius, Seoul
+
+if [ $# -ne 4 ]; then
+    echo "$0: <friendname> <friendemail> <your URL> <your name>"
+    echo 'F.i. $0 nico ipv6@nico.ungleich.cloud https://your-url.example.com'
+    exit 1
+fi
+
+friend=$1; shift
+email=$1;  shift
+url=$1;    shift
+name=$1;   shift
+
+keyurl=$url/rifkeys
+projecturl=https://code.ungleich.ch/nico/rif
+
+cat <<EOF | mail -s "Real IPv6 friend request" "${email}"
+Hello ${friend},
+
+I want to invite you to become my real IPv6 friend.
+You can find my friends including my key on ${keyurl}.
+
+On $projecturl you can find out how to become my friend.
+
+Looking forward to hearing from you,
+
+$name
+EOF