Skip to content

Make the script runnable as a regular user #17

@kke

Description

@kke

The only commands that currently need sudo are:

  curl -sSLf "$k0sDownloadUrl" >"$k0sInstallPath/$k0sBinary"
  chmod 755 -- "$k0sInstallPath/$k0sBinary"

The curl could (and maybe should) download the binary into a temp file first, after which the only command that would require sudo would be:

  install -o root -g root -m 755 "$k0s_tmp" "$k0sInstallPath/$k0sBinary"

The script could just run that last command via sudo/doas (or as is if uid==0, which would keep backwards compatibility with the current way of using the script).

If the command fails, it could offer something like:

Installation failed.
To finish installing manually, run the following command with elevated privileges (sudo):
   install -o root -g root -m 755 ./k0s-1.2.3-solaris-z80 /usr/local/bin/k0s

Slightly related: k0sproject/k0s#4932

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions