diff --git a/system/networkd_freebsd.go b/system/networkd_freebsd.go new file mode 100644 index 0000000..dd13e2a --- /dev/null +++ b/system/networkd_freebsd.go @@ -0,0 +1,21 @@ +// Copyright 2015 CoreOS, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package system + +import "github.com/vtolstov/cloudinit/network" + +func RestartNetwork(interfaces []network.InterfaceGenerator) (err error) { + return nil +} diff --git a/system/networkd.go b/system/networkd_linux.go similarity index 100% rename from system/networkd.go rename to system/networkd_linux.go diff --git a/system/ssh_key.go b/system/ssh_key.go index f897308..a75896c 100644 --- a/system/ssh_key.go +++ b/system/ssh_key.go @@ -36,6 +36,12 @@ func AuthorizeSSHKeys(user string, keysName string, keys []string) error { return err } + if _, err = os.Stat(home + "/.ssh"); err != nil { + if err = os.MkdirAll(home+"/.ssh", os.FileMode(0755)); err != nil { + return err + } + } + authorized_file := fmt.Sprintf("%s/.ssh/authorized_keys", home) f, err := os.OpenFile(authorized_file, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) if err != nil { diff --git a/system/systemd.go b/system/systemd.go index cc5e224..1eb5cc4 100644 --- a/system/systemd.go +++ b/system/systemd.go @@ -22,7 +22,7 @@ import ( "path" "strings" - "github.com/coreos/coreos-cloudinit/config" + "github.com/vtolstov/cloudinit/config" ) func NewUnitManager(root string) UnitManager {