[users] Overwrite host(s|name) files in target
This commit is contained in:
parent
4621937477
commit
8c527ab592
@ -31,6 +31,8 @@
|
||||
#include <QtDBus/QDBusInterface>
|
||||
#include <QtDBus/QDBusReply>
|
||||
|
||||
using WriteMode = CalamaresUtils::System::WriteMode;
|
||||
|
||||
SetHostNameJob::SetHostNameJob( const QString& hostname, Actions a )
|
||||
: Calamares::Job()
|
||||
, m_hostname( hostname )
|
||||
@ -61,8 +63,8 @@ SetHostNameJob::prettyStatusMessage() const
|
||||
STATICTEST bool
|
||||
setFileHostname( const QString& hostname )
|
||||
{
|
||||
return CalamaresUtils::System::instance()->createTargetFile( QStringLiteral( "/etc/hostname" ),
|
||||
( hostname + '\n' ).toUtf8() );
|
||||
return CalamaresUtils::System::instance()->createTargetFile(
|
||||
QStringLiteral( "/etc/hostname" ), ( hostname + '\n' ).toUtf8(), WriteMode::Overwrite );
|
||||
}
|
||||
|
||||
STATICTEST bool
|
||||
@ -77,8 +79,8 @@ ff02::1 ip6-allnodes
|
||||
ff02::2 ip6-allrouters
|
||||
)";
|
||||
|
||||
return CalamaresUtils::System::instance()->createTargetFile( QStringLiteral( "/etc/hosts" ),
|
||||
QString( etc_hosts ).arg( hostname ).toUtf8() );
|
||||
return CalamaresUtils::System::instance()->createTargetFile(
|
||||
QStringLiteral( "/etc/hosts" ), QString( etc_hosts ).arg( hostname ).toUtf8(), WriteMode::Overwrite );
|
||||
}
|
||||
|
||||
STATICTEST bool
|
||||
|
Loading…
Reference in New Issue
Block a user