nuageinit: add a function to bootstrap pkg if needed
Sponsored by: OVHCloud
This commit is contained in:
committed by
Baptiste Daroussin
parent
2f35a52183
commit
43b82d69b2
@@ -361,6 +361,15 @@ local function chpasswd(obj)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function pkg_bootstrap()
|
||||||
|
if os.execute("pkg -N 2>/dev/null") then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
print("Bootstrapping pkg")
|
||||||
|
return os.execute("env ASSUME_ALWAYS_YES=YES pkg bootstrap")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local n = {
|
local n = {
|
||||||
warn = warnmsg,
|
warn = warnmsg,
|
||||||
err = errmsg,
|
err = errmsg,
|
||||||
@@ -371,7 +380,8 @@ local n = {
|
|||||||
addgroup = addgroup,
|
addgroup = addgroup,
|
||||||
addsshkey = addsshkey,
|
addsshkey = addsshkey,
|
||||||
update_sshd_config = update_sshd_config,
|
update_sshd_config = update_sshd_config,
|
||||||
chpasswd = chpasswd
|
chpasswd = chpasswd,
|
||||||
|
pkg_bootstrap = pkg_bootstrap
|
||||||
}
|
}
|
||||||
|
|
||||||
return n
|
return n
|
||||||
|
|||||||
Reference in New Issue
Block a user