mirror of
https://github.com/danog/code-server.git
synced 2024-11-30 04:39:46 +01:00
feat: add doas support (#5600)
Some people may have some reason to drop sudo and switch to doas
This commit is contained in:
parent
77bbed4831
commit
3a9eb312b1
@ -553,6 +553,8 @@ sh_c() {
|
|||||||
sudo_sh_c() {
|
sudo_sh_c() {
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" = 0 ]; then
|
||||||
sh_c "$@"
|
sh_c "$@"
|
||||||
|
elif command_exists doas; then
|
||||||
|
sh_c "doas $*"
|
||||||
elif command_exists sudo; then
|
elif command_exists sudo; then
|
||||||
sh_c "sudo $*"
|
sh_c "sudo $*"
|
||||||
elif command_exists su; then
|
elif command_exists su; then
|
||||||
@ -561,7 +563,7 @@ sudo_sh_c() {
|
|||||||
echoh
|
echoh
|
||||||
echoerr "This script needs to run the following command as root."
|
echoerr "This script needs to run the following command as root."
|
||||||
echoerr " $*"
|
echoerr " $*"
|
||||||
echoerr "Please install sudo or su."
|
echoerr "Please install doas, sudo, or su."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user