summaryrefslogtreecommitdiffstats
path: root/btc/mining/bin/newkey.sh
diff options
context:
space:
mode:
Diffstat (limited to 'btc/mining/bin/newkey.sh')
-rwxr-xr-xbtc/mining/bin/newkey.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/btc/mining/bin/newkey.sh b/btc/mining/bin/newkey.sh
new file mode 100755
index 00000000..e71ab85b
--- /dev/null
+++ b/btc/mining/bin/newkey.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+auth=$HOME/.Xauthority
+cp /dev/null $auth
+
+if [ "$1" = "-md5" ]; then
+ key=`pstat -pfS | md5`
+else
+ key=`perl -e 'srand; printf int(rand(10000000000000))'`
+ key=$key$key
+fi
+
+xauth add unix:0 . $key
+
+xauth add ${HOST}:0 . $key