[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/QDBusInterface>
|
||||||
#include <QtDBus/QDBusReply>
|
#include <QtDBus/QDBusReply>
|
||||||
|
|
||||||
|
using WriteMode = CalamaresUtils::System::WriteMode;
|
||||||
|
|
||||||
SetHostNameJob::SetHostNameJob( const QString& hostname, Actions a )
|
SetHostNameJob::SetHostNameJob( const QString& hostname, Actions a )
|
||||||
: Calamares::Job()
|
: Calamares::Job()
|
||||||
, m_hostname( hostname )
|
, m_hostname( hostname )
|
||||||
@ -61,8 +63,8 @@ SetHostNameJob::prettyStatusMessage() const
|
|||||||
STATICTEST bool
|
STATICTEST bool
|
||||||
setFileHostname( const QString& hostname )
|
setFileHostname( const QString& hostname )
|
||||||
{
|
{
|
||||||
return CalamaresUtils::System::instance()->createTargetFile( QStringLiteral( "/etc/hostname" ),
|
return CalamaresUtils::System::instance()->createTargetFile(
|
||||||
( hostname + '\n' ).toUtf8() );
|
QStringLiteral( "/etc/hostname" ), ( hostname + '\n' ).toUtf8(), WriteMode::Overwrite );
|
||||||
}
|
}
|
||||||
|
|
||||||
STATICTEST bool
|
STATICTEST bool
|
||||||
@ -77,8 +79,8 @@ ff02::1 ip6-allnodes
|
|||||||
ff02::2 ip6-allrouters
|
ff02::2 ip6-allrouters
|
||||||
)";
|
)";
|
||||||
|
|
||||||
return CalamaresUtils::System::instance()->createTargetFile( QStringLiteral( "/etc/hosts" ),
|
return CalamaresUtils::System::instance()->createTargetFile(
|
||||||
QString( etc_hosts ).arg( hostname ).toUtf8() );
|
QStringLiteral( "/etc/hosts" ), QString( etc_hosts ).arg( hostname ).toUtf8(), WriteMode::Overwrite );
|
||||||
}
|
}
|
||||||
|
|
||||||
STATICTEST bool
|
STATICTEST bool
|
||||||
|
Loading…
Reference in New Issue
Block a user