Merge pull request #177 from illiliti/as_root_sls

kiss: add support for sls
This commit is contained in:
dylan 2020-08-30 10:30:24 +03:00 committed by GitHub
commit 2c3b2aa821
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

5
kiss
View File

@ -57,8 +57,9 @@ as_root() {
case ${su##*/} in
doas|sudo) "$su" -u "$user" -- env "$@" ;;
sls) "$su" -u "$user" -c -- env "$@" ;;
su) "$su" -c "env $* <&3" "$user" 3<&0 </dev/tty ;;
*) die "Invalid KISS_SU value: $su (valid: doas, sudo, su)"
*) die "Invalid KISS_SU value: $su (valid: doas, sudo, sls, su)"
esac
}
@ -1564,7 +1565,7 @@ main() {
# Figure out which 'sudo' command to use based on the user's choice or what
# is available on the system.
su=${KISS_SU:-$(command -v sudo || command -v doas)} || su=su
su=${KISS_SU:-$(command -v sudo || command -v doas || command -v sls)} || su=su
# Store the date and time of script invocation to be used as the name of
# the log files the package manager creates uring builds.