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
The only commands that currently need sudo are:
The
curlcould (and maybe should) download the binary into a temp file first, after which the only command that would require sudo would be: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:
Slightly related: k0sproject/k0s#4932