Add 'default' runlevel to x-ui service in Alpine

it should be 'default' runlevel when add x-ui service to openrc, default is 'sysinit' runlevel. 'sysinit' runlevel is unnecessary,maybe.
if not, there is an error when call to function 'check_enabled()' as command 'grep default -c' can`t print 'default' runlevel.

check_enabled() {
    if [[ $release == "alpine" ]]; then
        if [[ $(rc-update show | grep -F 'x-ui' | grep default -c) == 1 ]]; then
            return 0
        else
            return 1
        fi
This commit is contained in:
子寒 2026-02-25 19:47:44 +08:00 committed by GitHub
parent 37f0880f8f
commit f9ff3758a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -421,7 +421,7 @@ status() {
enable() {
if [[ $release == "alpine" ]]; then
rc-update add x-ui
rc-update add x-ui default
else
systemctl enable x-ui
fi