mirror of
https://shylinux.com/x/icebergs
synced 2025-04-27 01:48:27 +08:00
opt some
This commit is contained in:
parent
6cf4b75d5f
commit
c936ec4401
@ -1,6 +1,7 @@
|
|||||||
package nfs
|
package nfs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
@ -13,6 +14,7 @@ func _trash_create(m *ice.Message, from string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
s, e := StatFile(m, from)
|
s, e := StatFile(m, from)
|
||||||
|
defer os.Remove(from)
|
||||||
if m.Warn(e, ice.ErrNotFound, from) {
|
if m.Warn(e, ice.ErrNotFound, from) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -54,6 +56,4 @@ func init() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func Trash(m *ice.Message, p string) *ice.Message {
|
func Trash(m *ice.Message, p string) *ice.Message { return m.Cmd(TRASH, mdb.CREATE, p) }
|
||||||
return m.Cmd(TRASH, mdb.CREATE, p)
|
|
||||||
}
|
|
||||||
|
@ -27,7 +27,7 @@ func _spide_create(m *ice.Message, name, address string) {
|
|||||||
mdb.HashSelectUpdate(m, mdb.HashCreate(m, CLIENT_NAME, name), func(value ice.Map) {
|
mdb.HashSelectUpdate(m, mdb.HashCreate(m, CLIENT_NAME, name), func(value ice.Map) {
|
||||||
dir, file := path.Split(uri.EscapedPath())
|
dir, file := path.Split(uri.EscapedPath())
|
||||||
value[SPIDE_CLIENT] = kit.Dict(mdb.NAME, name, SPIDE_METHOD, http.MethodPost, "url", address, "origin", uri.Scheme+"://"+uri.Host,
|
value[SPIDE_CLIENT] = kit.Dict(mdb.NAME, name, SPIDE_METHOD, http.MethodPost, "url", address, "origin", uri.Scheme+"://"+uri.Host,
|
||||||
tcp.PROTOCOL, uri.Scheme, tcp.HOSTNAME, uri.Host, nfs.PATH, dir, nfs.FILE, file, "query", uri.RawQuery,
|
tcp.PROTOCOL, uri.Scheme, tcp.HOSTNAME, uri.Hostname(), tcp.HOST, uri.Host, nfs.PATH, dir, nfs.FILE, file, "query", uri.RawQuery,
|
||||||
cli.TIMEOUT, "30s", LOGHEADERS, ice.FALSE,
|
cli.TIMEOUT, "30s", LOGHEADERS, ice.FALSE,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -167,7 +167,8 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
RELAY: {Name: "relay alias username host port=22 init", Help: "跳板", Hand: func(m *ice.Message, arg ...string) {
|
RELAY: {Name: "relay alias username host port=22 init", Help: "跳板", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(COMPILE, RELAY)
|
m.Cmdy(COMPILE, RELAY)
|
||||||
m.Cmdy(nfs.LINK, ice.USR_PUBLISH+m.Option(mdb.ALIAS), ice.USR_PUBLISH+RELAY)
|
// m.Cmdy(nfs.LINK, ice.USR_PUBLISH+m.Option(mdb.ALIAS), ice.USR_PUBLISH+RELAY)
|
||||||
|
m.Cmdy(cli.SYSTEM, "ln", "-s", RELAY, ice.USR_PUBLISH+m.Option(mdb.ALIAS))
|
||||||
m.Cmd(nfs.SAVE, path.Join(kit.Env(cli.HOME), ".ssh/"+m.Option(mdb.ALIAS)+".json"),
|
m.Cmd(nfs.SAVE, path.Join(kit.Env(cli.HOME), ".ssh/"+m.Option(mdb.ALIAS)+".json"),
|
||||||
kit.Formats(kit.Dict(m.OptionSimple("username,host,port,init"))))
|
kit.Formats(kit.Dict(m.OptionSimple("username,host,port,init"))))
|
||||||
}},
|
}},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user