Fix format: Change spaces by tabs

This commit is contained in:
Yonatan Romero 2022-09-19 18:09:55 +02:00
parent bdce0a39e8
commit e4b4403d32
No known key found for this signature in database
GPG Key ID: 28EEA3C26EDA40BC
1 changed files with 3 additions and 3 deletions

View File

@ -273,7 +273,7 @@ func installSystemd(templateArgs *ServiceTemplateArgs, log *zerolog.Logger) erro
}
}
// Create the cloudflared user if it does not exist
if err := runCommand("grep", "-q", fmt.Sprintf("^%s:", cloudflaredUser), "/etc/passwd"); err != nil {
if err := runCommand("grep", "-q", fmt.Sprintf("^%s:", cloudflaredUser), "/etc/passwd"); err != nil {
if err := runCommand("useradd", "--system", "--no-create-home", "--home-dir=/nonexistent", "--shell=/usr/sbin/nologin", cloudflaredUser); err != nil {
log.Err(err).Msgf("useradd %s error", cloudflaredUser)
return err
@ -350,12 +350,12 @@ func uninstallSystemd(log *zerolog.Logger) error {
return err
}
// Delete the cloudflared user if it exists
if err := runCommand("grep", "-q", fmt.Sprintf("^%s:", cloudflaredUser), "/etc/passwd"); err == nil {
if err := runCommand("grep", "-q", fmt.Sprintf("^%s:", cloudflaredUser), "/etc/passwd"); err == nil {
if err := runCommand("userdel", cloudflaredUser); err != nil {
log.Err(err).Msgf("userdel %s error", cloudflaredUser)
return err
}
}
}
for _, serviceTemplate := range systemdTemplates {
if err := serviceTemplate.Remove(); err != nil {
log.Err(err).Msg("error removing service template")