summaryrefslogtreecommitdiff
path: root/byteback-setup-client-receive
diff options
context:
space:
mode:
authorMatthew Bloch <matthew@bytemark.co.uk>2014-12-04 18:04:17 +0000
committerMatthew Bloch <matthew@bytemark.co.uk>2014-12-04 18:04:17 +0000
commita7162ddb80be70443d5617cac5d71ce6521e9f42 (patch)
treebd31bd313c282bae3f05868115db66f05b9cab77 /byteback-setup-client-receive
parent2fb6dde5a5bf3d7090d2a4b8f8770341c9cb3781 (diff)
More small fixes to make sure client setup goes smoothly.
Diffstat (limited to 'byteback-setup-client-receive')
-rwxr-xr-xbyteback-setup-client-receive5
1 files changed, 4 insertions, 1 deletions
diff --git a/byteback-setup-client-receive b/byteback-setup-client-receive
index 79df12b..d98eab2 100755
--- a/byteback-setup-client-receive
+++ b/byteback-setup-client-receive
@@ -32,6 +32,9 @@ Dir.mkdir(@hostname)
error("Couldn't create btrfs subvolume (needs sudo)") unless
system("sudo btrfs subvolume create #{@hostname}/current")
+error("Couldn't set ownership of new subvolume (need sudo)") unless
+ system("sudo chown byteback "+File.expand_path("#{@hostname}/current"))
+
FileUtils.mkdir_p(".ssh")
if File.exists?(".ssh/authorized_keys") &&
@@ -42,7 +45,7 @@ if File.exists?(".ssh/authorized_keys") &&
else
File.open(".ssh/authorized_keys", "a+") do |fh|
- fh.print <<-LINE.gsub(/\n/,"")
+ fh.print <<-LINE.gsub(/\n/,"") + "\n"
command="byteback-receive",
from="#{@client_ip}",
environment="BYTEBACK_HOST=#{@hostname}"