summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/db/ip/cidr1
-rw-r--r--scripts/db/ip/owner1
-rwxr-xr-xscripts/nameserver_autogen/bind_tld_zonefile7
-rw-r--r--scripts/update-git-remotes33
4 files changed, 38 insertions, 4 deletions
diff --git a/scripts/db/ip/cidr b/scripts/db/ip/cidr
deleted file mode 100644
index 08e0d8a..0000000
--- a/scripts/db/ip/cidr
+++ /dev/null
@@ -1 +0,0 @@
-1.22.187
diff --git a/scripts/db/ip/owner b/scripts/db/ip/owner
deleted file mode 100644
index d5fe3b2..0000000
--- a/scripts/db/ip/owner
+++ /dev/null
@@ -1 +0,0 @@
-Vutral
diff --git a/scripts/nameserver_autogen/bind_tld_zonefile b/scripts/nameserver_autogen/bind_tld_zonefile
index 4755cfd..344bb4e 100755
--- a/scripts/nameserver_autogen/bind_tld_zonefile
+++ b/scripts/nameserver_autogen/bind_tld_zonefile
@@ -8,11 +8,14 @@ foreach ($names as $name) {
$servers = scandir($name.'/ns/');
foreach ($servers as $server) {
if ($server[0] == '.') continue;
- print($name.' IN NS '.$server."\n");
+ if (substr($name, -4) == ".ano") $name .= ".";
+ $fqserver = $server;
+ if (substr($server, -4) == ".ano") $fqserver .= ".";
+ print($name.' IN NS '.$fqserver."\n");
$ips = file($name.'/ns/'.$server, FILE_IGNORE_NEW_LINES |
FILE_SKIP_EMPTY_LINES);
foreach ($ips as $ip) {
- print($server.' IN A '.$ip."\n");
+ print($fqserver.' IN A '.$ip."\n");
}
}
}
diff --git a/scripts/update-git-remotes b/scripts/update-git-remotes
new file mode 100644
index 0000000..8048d54
--- /dev/null
+++ b/scripts/update-git-remotes
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# Creates git remotes from the user db
+# TODO: detect users' git address changes
+#
+
+if ! ./scripts/check_db_safety; then
+ exit 1
+fi
+
+USR_DB_DIR=./db/usr
+GIT_REPO=./.git
+GIT_REMOTES_DIR=$GIT_REPO/refs/remotes
+
+for u in `ls -1 $USR_DB_DIR`; do
+ git_url_file="$USR_DB_DIR/$u/git"
+
+ if [ -f $git_url_file ]; then
+ git_url=`cat $git_url_file`
+ git_remote_name="anonet_$u"
+
+ if [ -d $GIT_REMOTES_DIR/$git_remote_name ]; then
+ # The remote already exists;
+ # TODO: Update it if it has changed.
+ echo "skipping $u" >&2
+
+ else
+ git remote add -t master -m master $git_remote_name $git_url
+
+ fi
+
+ fi
+done