2013-11-19 18:45:21 +00:00
|
|
|
function __fish_print_service_names -d 'All services known to the system'
|
2016-02-07 13:52:08 +00:00
|
|
|
if test -d /run/systemd/system # Systemd systems
|
2016-11-28 05:27:22 +00:00
|
|
|
# For the `service` command, this needs to be without the type suffix
|
|
|
|
# on Debian at least
|
|
|
|
__fish_systemctl_services | string replace -r '.service$' ''
|
2018-04-01 20:42:38 +00:00
|
|
|
else if type -f rc-service 2>/dev/null # OpenRC (Gentoo)
|
2013-11-19 18:45:21 +00:00
|
|
|
command rc-service -l
|
2016-02-07 13:52:08 +00:00
|
|
|
else if test -d /etc/init.d # SysV on Debian and other linuxen
|
2016-11-28 05:27:22 +00:00
|
|
|
string replace '/etc/init.d/' '' -- /etc/init.d/*
|
|
|
|
else # Freebsd
|
|
|
|
command service -l
|
2013-11-19 18:45:21 +00:00
|
|
|
end
|
|
|
|
end
|