shithub: sirjofri_de

Download patch

ref: 43a34442c946fa387bef7968a036a62436868bd8
parent: 5f273ef2ad8644b2474bdbe955b248e10b196702
author: sirjofri <sirjofri@sirjofri.de>
date: Thu Jul 2 04:07:43 EDT 2020

adds griddy file (9gridchan)

--- a/pub/files/.htaccess
+++ b/pub/files/.htaccess
@@ -7,3 +7,4 @@
 ReadmeName /files/foot.html
 
 AddDescription "easy/simple replica(1) wizard" guidedreplica
+AddDescription "9gridchan gridstart alternative" griddy
--- /dev/null
+++ b/pub/files/griddy
@@ -1,0 +1,55 @@
+#!/bin/rc
+
+flagfmt='t:tls,p:pub,q:quiet'
+
+if(! ifs=() eval `{aux/getflags $*}){
+	aux/usage
+	echo ' -t  prefer tls
+ -p  mount pubregistry services
+ -q  quiet. Don''t ask, just do.' >[1=2]
+	exit usage
+}
+
+# remove old services
+test -e /srv/gridregistry && {
+	if(~ $quiet 1) ans=n
+	if not{
+		echo 'old grid connections found in /srv, remove? (y/n)'
+		ans=`{read}
+	}
+	if(~ $ans y){
+		echo 'removing old'
+		rm /srv/gridchat
+		rm /srv/gridplumber
+		rm /srv/gridram
+		rm /srv/gridregistry
+		rm /srv/gridroot
+		rm /srv/gridwiki
+		rm /srv/griddisk
+		rm /srv/pubregistry
+	}
+}
+
+# mount grid services (from registry)
+~ $tls 1 && {
+	echo 'mount services (tls)'
+	test -r /mnt/factotum/ctl || auth/factotum -n
+	echo 'key proto=dp9ik user=glenda dom=grid !password=9gridchan' >/mnt/factotum/ctl
+	srvtls tcp!registry.9gridchan.org!16675 gridregistry /mnt/registry
+	awk '/tlssrv/{print "srvtls -c", $1, $3, $5}' /mnt/registry/index | rc
+}
+~ $tls 1 || {
+	echo 'mount services (no tls)'
+	srv tcp!registry.9gridchan.org!6675 gridregistry /mnt/registry
+	awk '/exportfs/{print "srv -c", $1, $3, $5}' /mnt/registry/index | rc
+}
+
+# mount public grid services (from pubregistry)
+~ $pub 1 && {
+	echo 'mount public services (pubregistry)'
+	test -r /n/pubregistry/index || { echo 'pubregistry not found' >[1=2] }
+	test -r /n/pubregistry/index && {
+		awk '/tlssrv/{print "srvtls -c", $1, $3, $5}' /n/pubregistry/index
+		awk '/exportfs/{print "srv -c", $1, $3, $5}' /n/pubregistry/index
+	} | rc
+}