33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
# File 'src/lib/installation/clients/ssh_settings_finish.rb', line 33
def main
textdomain "installation"
Yast.import "Linuxrc"
Yast.import "Installation"
Yast.import "String"
@ret = nil
@func = ""
@param = {}
if Ops.greater_than(Builtins.size(WFM.Args), 0) &&
Ops.is_string?(WFM.Args(0))
@func = Convert.to_string(WFM.Args(0))
if Ops.greater_than(Builtins.size(WFM.Args), 1) &&
Ops.is_map?(WFM.Args(1))
@param = Convert.to_map(WFM.Args(1))
end
end
Builtins.y2milestone("starting ssh_settings_finish")
Builtins.y2debug("func=%1", @func)
Builtins.y2debug("param=%1", @param)
case @func
when "Info"
return {
"steps" => 1,
"title" => _(
"Copying SSH settings to installed system..."
),
"when" => Linuxrc.usessh ? [:installation, :autoinst] : []
}
when "Write"
WFM.Execute(
path(".local.bash"),
Ops.add(
Ops.add(
"umask 077 ; awk -F : ' /^root:/ { print $1\":\"$2 }' < /etc/shadow > " + "'",
String.Quote(Installation.destdir)
),
"/tmp/rootpwd.txt'"
)
)
SCR.Execute(
path(".target.bash"),
"/bin/cat /tmp/rootpwd.txt | /usr/sbin/chpasswd -e ; rm -fv /tmp/rootpwd.txt"
)
WFM.Execute(
path(".local.bash"),
Ops.add(
Ops.add(
"/bin/cp -a /etc/ssh/*key* '",
String.Quote(Installation.destdir)
),
"/etc/ssh/'"
)
)
else
Builtins.y2error("unknown function: %1", @func)
@ret = nil
end
Builtins.y2debug("ret=%1", @ret)
Builtins.y2milestone("ssh_settings_finish finished")
deep_copy(@ret)
end
|