mirror of
https://github.com/systemd/systemd
synced 2025-10-07 20:54:45 +02:00
Compare commits
No commits in common. "5b94f463f020856c37e8dfb456626b7dd6d1255e" and "7ebbe57ecef3fc7e06c638951c3397b679e8a99e" have entirely different histories.
5b94f463f0
...
7ebbe57ece
@ -25,7 +25,7 @@ __contains_word () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__get_entry_ids() {
|
__get_entry_ids() {
|
||||||
bootctl --no-pager list 2>/dev/null | { while read -r a b; do [[ $a == 'id:' ]] && echo " $b"; done; }
|
bootctl --no-pager list 2>/dev/null | { while read -r a b; do [[ $a == 'id:' ]] && echo " $b"; done }
|
||||||
}
|
}
|
||||||
|
|
||||||
_bootctl() {
|
_bootctl() {
|
||||||
@ -94,7 +94,7 @@ _bootctl() {
|
|||||||
if ! __contains_word "${COMP_WORDS[i]}" ${OPTS[*]} ${VERBS[*]} &&
|
if ! __contains_word "${COMP_WORDS[i]}" ${OPTS[*]} ${VERBS[*]} &&
|
||||||
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
||||||
name=${COMP_WORDS[i]}
|
name=${COMP_WORDS[i]}
|
||||||
break
|
break;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ __contains_word () {
|
|||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
{ while read -r a b; do echo " $a"; done; } |
|
{ while read a b; do echo " $a"; done; } | \
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ __get_busnames() {
|
|||||||
local mode=$1
|
local mode=$1
|
||||||
local a b
|
local a b
|
||||||
busctl $mode list --no-legend --no-pager --full 2>/dev/null |
|
busctl $mode list --no-legend --no-pager --full 2>/dev/null |
|
||||||
{ while read -r a b; do echo " $a"; done; }
|
{ while read a b; do echo " $a"; done; };
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_objects() {
|
__get_objects() {
|
||||||
@ -43,7 +43,7 @@ __get_objects() {
|
|||||||
local busname=$2
|
local busname=$2
|
||||||
local a b
|
local a b
|
||||||
busctl $mode tree --list --no-legend --no-pager $busname 2>/dev/null |
|
busctl $mode tree --list --no-legend --no-pager $busname 2>/dev/null |
|
||||||
{ while read -r a b; do echo " $a"; done; }
|
{ while read a b; do echo " $a"; done; };
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_interfaces() {
|
__get_interfaces() {
|
||||||
@ -52,7 +52,7 @@ __get_interfaces() {
|
|||||||
local path=$3
|
local path=$3
|
||||||
local a b c
|
local a b c
|
||||||
busctl $mode introspect --list --no-legend --no-pager $busname $path 2>/dev/null |
|
busctl $mode introspect --list --no-legend --no-pager $busname $path 2>/dev/null |
|
||||||
{ while read -r a b c; do [[ "$b" == "interface" ]] && echo " $a"; done; }
|
{ while read a b c; do [[ "$b" == "interface" ]] && echo " $a"; done; };
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_members() {
|
__get_members() {
|
||||||
@ -65,7 +65,7 @@ __get_members() {
|
|||||||
local a b c d e
|
local a b c d e
|
||||||
busctl $mode introspect --list --no-legend --no-pager $busname $path $interface 2>/dev/null |
|
busctl $mode introspect --list --no-legend --no-pager $busname $path $interface 2>/dev/null |
|
||||||
sed -e 's/^\.//' |
|
sed -e 's/^\.//' |
|
||||||
{ while read -r a b c d e; do [[ "$b" == "$type" && ( -z $flags || "$e" == "$flags" ) ]] && echo " $a"; done; }
|
{ while read a b c d e; do [[ "$b" == "$type" && ( -z $flags || "$e" == "$flags" ) ]] && echo " $a"; done; };
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_signature() {
|
__get_signature() {
|
||||||
@ -76,7 +76,7 @@ __get_signature() {
|
|||||||
local member=$5
|
local member=$5
|
||||||
local a b c d
|
local a b c d
|
||||||
busctl $mode introspect --list --no-legend --no-pager $busname $path $interface 2>/dev/null |
|
busctl $mode introspect --list --no-legend --no-pager $busname $path $interface 2>/dev/null |
|
||||||
sed -e 's/^\.//' | { while read -r a b c d; do [[ "$a" == "$member" && "$c" != '-' ]] && echo " \"$c\""; done; }
|
sed -e 's/^\.//' | { while read a b c d; do [[ "$a" == "$member" && "$c" != '-' ]] && echo " \"$c\""; done; };
|
||||||
}
|
}
|
||||||
|
|
||||||
_busctl() {
|
_busctl() {
|
||||||
|
@ -27,7 +27,7 @@ __contains_word () {
|
|||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
machinectl list --full --no-legend --no-pager 2>/dev/null |
|
machinectl list --full --no-legend --no-pager 2>/dev/null |
|
||||||
{ while read -r a b; do echo " $a"; done; }
|
{ while read a b; do echo " $a"; done; };
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_homes() {
|
__get_homes() {
|
||||||
|
@ -29,7 +29,7 @@ __contains_word () {
|
|||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
machinectl list --full --no-legend --no-pager 2>/dev/null |
|
machinectl list --full --no-legend --no-pager 2>/dev/null |
|
||||||
{ while read -r a b; do echo " $a"; done; }
|
{ while read a b; do echo " $a"; done; };
|
||||||
}
|
}
|
||||||
|
|
||||||
_hostnamectl() {
|
_hostnamectl() {
|
||||||
|
@ -26,12 +26,8 @@ __contains_word() {
|
|||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
{
|
{ machinectl list-images --full --no-legend --no-pager 2>/dev/null; machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
machinectl list-images --full --no-legend --no-pager 2>/dev/null
|
{ while read a b; do echo " $a"; done; } | \
|
||||||
machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null
|
|
||||||
echo ".host"
|
|
||||||
} |
|
|
||||||
{ while read -r a b; do echo " $a"; done; } |
|
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@ __contains_word () {
|
|||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
{ while read -r a b; do echo " $a"; done; } |
|
{ while read a b; do echo " $a"; done; } | \
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ _journalctl() {
|
|||||||
if __contains_word "$prev" '>' '>>' '&>'; then
|
if __contains_word "$prev" '>' '>>' '&>'; then
|
||||||
compopt -o filenames
|
compopt -o filenames
|
||||||
COMPREPLY=( $(compgen -f -- "$cur") )
|
COMPREPLY=( $(compgen -f -- "$cur") )
|
||||||
return 0
|
return 0;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if __contains_word "$prev" ${OPTS[ARG]} ${OPTS[ARGUNKNOWN]}; then
|
if __contains_word "$prev" ${OPTS[ARG]} ${OPTS[ARGUNKNOWN]}; then
|
||||||
@ -81,7 +81,7 @@ _journalctl() {
|
|||||||
comps=$( journalctl --output=help 2>/dev/null )
|
comps=$( journalctl --output=help 2>/dev/null )
|
||||||
;;
|
;;
|
||||||
--field|-F)
|
--field|-F)
|
||||||
comps=$(journalctl --fields 2>/dev/null | sort)
|
comps=$(journalctl --fields | sort 2>/dev/null)
|
||||||
;;
|
;;
|
||||||
--machine|-M)
|
--machine|-M)
|
||||||
comps=$( __get_machines )
|
comps=$( __get_machines )
|
||||||
|
@ -36,11 +36,11 @@ _kernel_install() {
|
|||||||
comps="add remove"
|
comps="add remove"
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
comps=$(cd /lib/modules && echo [0-9]*)
|
comps=$(cd /lib/modules; echo [0-9]*)
|
||||||
if [[ ${COMP_WORDS[1]} == "remove" ]] && [[ -f /etc/machine-id ]]; then
|
if [[ ${COMP_WORDS[1]} == "remove" ]] && [[ -f /etc/machine-id ]]; then
|
||||||
read -r MACHINE_ID < /etc/machine-id
|
read MACHINE_ID < /etc/machine-id
|
||||||
if [[ $MACHINE_ID ]] && ( [[ -d /boot/$MACHINE_ID ]] || [[ -L /boot/$MACHINE_ID ]] ); then
|
if [[ $MACHINE_ID ]] && ( [[ -d /boot/$MACHINE_ID ]] || [[ -L /boot/$MACHINE_ID ]] ); then
|
||||||
comps=$(cd "/boot/$MACHINE_ID" && echo [0-9]*)
|
comps=$(cd "/boot/$MACHINE_ID"; echo [0-9]*)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -26,14 +26,14 @@ __contains_word () {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_all_sessions () { loginctl --no-legend list-sessions 2>/dev/null | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
|
__get_all_sessions () { loginctl --no-legend list-sessions | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
|
||||||
__get_all_users () { loginctl --no-legend list-users 2>/dev/null | { while read -r a b; do printf "%s\n" "$b"; done; } ; }
|
__get_all_users () { loginctl --no-legend list-users | { while read -r a b; do printf "%s\n" "$b"; done; } ; }
|
||||||
__get_all_seats () { loginctl --no-legend list-seats 2>/dev/null | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
|
__get_all_seats () { loginctl --no-legend list-seats | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
|
||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
{ while read -r a b; do echo " $a"; done; } |
|
{ while read a b; do echo " $a"; done; } | \
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ __contains_word() {
|
|||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
{ machinectl list-images --full --no-legend --no-pager 2>/dev/null; machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
{ machinectl list-images --full --no-legend --no-pager 2>/dev/null; machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
{ while read -r a b; do echo " $a"; done; } |
|
{ while read a b; do echo " $a"; done; } | \
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ __contains_word () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__get_links() {
|
__get_links() {
|
||||||
networkctl list --no-legend --no-pager --all --full 2>/dev/null | { while read -r a b c; do echo " $b"; done; }
|
networkctl list --no-legend --no-pager --all --full | { while read -r a b c; do echo " $b"; done; };
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_links_with_prefix() {
|
__get_links_with_prefix() {
|
||||||
@ -70,7 +70,7 @@ _networkctl() {
|
|||||||
if __contains_word "$prev" ${OPTS[ARG]}; then
|
if __contains_word "$prev" ${OPTS[ARG]}; then
|
||||||
case $prev in
|
case $prev in
|
||||||
--json)
|
--json)
|
||||||
comps=$(networkctl --json=help 2>/dev/null)
|
comps=$(networkctl --json=help)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
return 0
|
return 0
|
||||||
|
@ -26,8 +26,8 @@ __contains_word () {
|
|||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
{ while read -r a b; do echo " $a"; done; } |
|
{ while read a b; do echo " $a"; done; } | \
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ _resolvectl() {
|
|||||||
comps=$( __get_interfaces )
|
comps=$( __get_interfaces )
|
||||||
;;
|
;;
|
||||||
--protocol|-p|--type|-t|--class|-c|--json)
|
--protocol|-p|--type|-t|--class|-c|--json)
|
||||||
comps=$( resolvectl --legend=no "$prev" help 2>/dev/null; echo help )
|
comps=$( resolvectl --legend=no "$prev" help; echo help )
|
||||||
;;
|
;;
|
||||||
--raw)
|
--raw)
|
||||||
comps="payload packet"
|
comps="payload packet"
|
||||||
@ -107,7 +107,7 @@ _resolvectl() {
|
|||||||
if __contains_word "${COMP_WORDS[i]}" ${ARGS[FAMILY]} &&
|
if __contains_word "${COMP_WORDS[i]}" ${ARGS[FAMILY]} &&
|
||||||
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
||||||
name=${COMP_WORDS[i]}
|
name=${COMP_WORDS[i]}
|
||||||
break
|
break;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [[ -z $name ]]; then
|
if [[ -z $name ]]; then
|
||||||
@ -122,7 +122,7 @@ _resolvectl() {
|
|||||||
if __contains_word "${COMP_WORDS[i]}" $interfaces &&
|
if __contains_word "${COMP_WORDS[i]}" $interfaces &&
|
||||||
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
||||||
name=${COMP_WORDS[i]}
|
name=${COMP_WORDS[i]}
|
||||||
break
|
break;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ _resolvectl() {
|
|||||||
if __contains_word "${COMP_WORDS[i]}" ${ARGS[RESOLVE]} &&
|
if __contains_word "${COMP_WORDS[i]}" ${ARGS[RESOLVE]} &&
|
||||||
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
||||||
name=${COMP_WORDS[i]}
|
name=${COMP_WORDS[i]}
|
||||||
break
|
break;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ _resolvectl() {
|
|||||||
if __contains_word "${COMP_WORDS[i]}" ${ARGS[BOOLEAN]} &&
|
if __contains_word "${COMP_WORDS[i]}" ${ARGS[BOOLEAN]} &&
|
||||||
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
||||||
name=${COMP_WORDS[i]}
|
name=${COMP_WORDS[i]}
|
||||||
break
|
break;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ _resolvectl() {
|
|||||||
if __contains_word "${COMP_WORDS[i]}" ${ARGS[DNSSEC]} &&
|
if __contains_word "${COMP_WORDS[i]}" ${ARGS[DNSSEC]} &&
|
||||||
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
||||||
name=${COMP_WORDS[i]}
|
name=${COMP_WORDS[i]}
|
||||||
break
|
break;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ _resolvectl() {
|
|||||||
if __contains_word "${COMP_WORDS[i]}" ${ARGS[DNSOVERTLS]} &&
|
if __contains_word "${COMP_WORDS[i]}" ${ARGS[DNSOVERTLS]} &&
|
||||||
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
||||||
name=${COMP_WORDS[i]}
|
name=${COMP_WORDS[i]}
|
||||||
break
|
break;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -21,13 +21,13 @@ __systemctl() {
|
|||||||
systemctl --system --full --no-legend --no-pager --plain "$@"
|
systemctl --system --full --no-legend --no-pager --plain "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_slice_units () { __systemctl list-units --all -t slice 2>/dev/null |
|
__get_slice_units () { __systemctl list-units --all -t slice \
|
||||||
{ while read -r a b c d; do echo " $a"; done; }; }
|
| { while read -r a b c d; do echo " $a"; done; }; }
|
||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
{ while read -r a b; do echo " $a"; done; } |
|
{ while read a b; do echo " $a"; done; } | \
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ __systemctl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__systemd_properties() {
|
__systemd_properties() {
|
||||||
{{LIBEXECDIR}}/systemd --dump-bus-properties 2>/dev/null
|
{{LIBEXECDIR}}/systemd --dump-bus-properties
|
||||||
}
|
}
|
||||||
|
|
||||||
__contains_word () {
|
__contains_word () {
|
||||||
@ -55,20 +55,20 @@ __filter_units_by_properties () {
|
|||||||
}
|
}
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
__get_all_units () { { __systemctl $1 list-unit-files "$2*"; __systemctl $1 list-units --all "$2*"; } |
|
__get_all_units () { { __systemctl $1 list-unit-files "$2*"; __systemctl $1 list-units --all "$2*"; } \
|
||||||
{ while read -r a b; do echo " $a"; done; }; }
|
| { while read -r a b; do echo " $a"; done; }; }
|
||||||
__get_non_template_units() { { __systemctl $1 list-unit-files "$2*"; __systemctl $1 list-units --all "$2*"; } |
|
__get_non_template_units() { { __systemctl $1 list-unit-files "$2*"; __systemctl $1 list-units --all "$2*"; } \
|
||||||
{ while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }; }
|
| { while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }; }
|
||||||
__get_template_names () { __systemctl $1 list-unit-files "$2*" |
|
__get_template_names () { __systemctl $1 list-unit-files "$2*" \
|
||||||
{ while read -r a b; do [[ $a =~ @\. ]] && echo " ${a%%@.*}@"; done; }; }
|
| { while read -r a b; do [[ $a =~ @\. ]] && echo " ${a%%@.*}@"; done; }; }
|
||||||
__get_active_units () { __systemctl $1 list-units "$2*" |
|
__get_active_units () { __systemctl $1 list-units "$2*" \
|
||||||
{ while read -r a b; do echo " $a"; done; }; }
|
| { while read -r a b; do echo " $a"; done; }; }
|
||||||
__get_active_services() { __systemctl $1 list-units "$2*.service" |
|
__get_active_services() { __systemctl $1 list-units "$2*.service" \
|
||||||
{ while read -r a b; do echo " $a"; done; }; }
|
| { while read -r a b; do echo " $a"; done; }; }
|
||||||
|
|
||||||
__get_not_masked_unit_files() {
|
__get_not_masked_unit_files() {
|
||||||
# filter out masked, not-found, or template units.
|
# filter out masked, not-found, or template units.
|
||||||
__systemctl $1 list-unit-files --state enabled,enabled-runtime,linked,linked-runtime,static,indirect,disabled,generated,transient "$2*" |
|
__systemctl $1 list-unit-files --state enabled,enabled-runtime,linked,linked-runtime,static,indirect,disabled,generated,transient "$2*" | \
|
||||||
{ while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }
|
{ while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ __get_startable_units () {
|
|||||||
__filter_units_by_properties $1 ActiveState=inactive,CanStart=yes $(
|
__filter_units_by_properties $1 ActiveState=inactive,CanStart=yes $(
|
||||||
{ __get_not_masked_unit_files $1 $2
|
{ __get_not_masked_unit_files $1 $2
|
||||||
# get inactive template units
|
# get inactive template units
|
||||||
__systemctl $1 list-units --state inactive,failed "$2*" |
|
__systemctl $1 list-units --state inactive,failed "$2*" | \
|
||||||
{ while read -r a b c; do [[ $b == "loaded" ]] && echo " $a"; done; }
|
{ while read -r a b c; do [[ $b == "loaded" ]] && echo " $a"; done; }
|
||||||
} | sort -u )
|
} | sort -u )
|
||||||
}
|
}
|
||||||
@ -107,20 +107,20 @@ __get_reloadable_units () {
|
|||||||
} | sort -u )
|
} | sort -u )
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_failed_units() { __systemctl $1 list-units "$2*" |
|
__get_failed_units() { __systemctl $1 list-units "$2*" \
|
||||||
while read -r a b c d; do [[ $c == "failed" ]] && echo " $a"; done; }
|
| while read -r a b c d; do [[ $c == "failed" ]] && echo " $a"; done; }
|
||||||
__get_enabled_units() { __systemctl $1 list-unit-files "$2*" |
|
__get_enabled_units() { __systemctl $1 list-unit-files "$2*" \
|
||||||
while read -r a b c ; do [[ $b == "enabled" ]] && echo " $a"; done; }
|
| while read -r a b c ; do [[ $b == "enabled" ]] && echo " $a"; done; }
|
||||||
__get_disabled_units() { __systemctl $1 list-unit-files "$2*" |
|
__get_disabled_units() { __systemctl $1 list-unit-files "$2*" \
|
||||||
while read -r a b c ; do [[ $b == "disabled" ]] && echo " $a"; done; }
|
| while read -r a b c ; do [[ $b == "disabled" ]] && echo " $a"; done; }
|
||||||
__get_masked_units() { __systemctl $1 list-unit-files "$2*" |
|
__get_masked_units() { __systemctl $1 list-unit-files "$2*" \
|
||||||
while read -r a b c ; do [[ $b == "masked" ]] && echo " $a"; done; }
|
| while read -r a b c ; do [[ $b == "masked" ]] && echo " $a"; done; }
|
||||||
__get_all_unit_files() { __systemctl $1 list-unit-files "$2*" | while read -r a b; do echo " $a"; done; }
|
__get_all_unit_files() { __systemctl $1 list-unit-files "$2*" | while read -r a b; do echo " $a"; done; }
|
||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a
|
local a
|
||||||
|
|
||||||
while read -r a _; do
|
while read a _; do
|
||||||
echo " $a"
|
echo " $a"
|
||||||
done < <(machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null | sort -u; echo ".host")
|
done < <(machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null | sort -u; echo ".host")
|
||||||
}
|
}
|
||||||
@ -291,13 +291,13 @@ _systemctl () {
|
|||||||
compopt -o filenames
|
compopt -o filenames
|
||||||
|
|
||||||
elif __contains_word "$verb" ${VERBS[DISABLED_UNITS]}; then
|
elif __contains_word "$verb" ${VERBS[DISABLED_UNITS]}; then
|
||||||
comps=$( __get_disabled_units $mode "$cur"
|
comps=$( __get_disabled_units $mode "$cur";
|
||||||
__get_template_names $mode "$cur")
|
__get_template_names $mode "$cur")
|
||||||
compopt -o filenames
|
compopt -o filenames
|
||||||
|
|
||||||
elif __contains_word "$verb" ${VERBS[REENABLABLE_UNITS]}; then
|
elif __contains_word "$verb" ${VERBS[REENABLABLE_UNITS]}; then
|
||||||
comps=$( __get_disabled_units $mode "$cur"
|
comps=$( __get_disabled_units $mode "$cur";
|
||||||
__get_enabled_units $mode "$cur"
|
__get_enabled_units $mode "$cur";
|
||||||
__get_template_names $mode "$cur")
|
__get_template_names $mode "$cur")
|
||||||
compopt -o filenames
|
compopt -o filenames
|
||||||
|
|
||||||
@ -331,10 +331,10 @@ _systemctl () {
|
|||||||
compopt -o filenames
|
compopt -o filenames
|
||||||
|
|
||||||
elif __contains_word "$verb" ${VERBS[TARGET_AND_UNITS]}; then
|
elif __contains_word "$verb" ${VERBS[TARGET_AND_UNITS]}; then
|
||||||
if __contains_word "$prev" ${VERBS[TARGET_AND_UNITS]} ||
|
if __contains_word "$prev" ${VERBS[TARGET_AND_UNITS]} \
|
||||||
__contains_word "$prev" ${OPTS[STANDALONE]}; then
|
|| __contains_word "$prev" ${OPTS[STANDALONE]}; then
|
||||||
comps=$( __systemctl $mode list-unit-files --type target --all "$cur*" |
|
comps=$( __systemctl $mode list-unit-files --type target --all "$cur*" \
|
||||||
{ while read -r a b; do echo " $a"; done; } )
|
| { while read -r a b; do echo " $a"; done; } )
|
||||||
else
|
else
|
||||||
comps=$( __get_all_unit_files $mode "$cur" )
|
comps=$( __get_all_unit_files $mode "$cur" )
|
||||||
fi
|
fi
|
||||||
@ -347,13 +347,13 @@ _systemctl () {
|
|||||||
comps=$( __systemctl $mode list-jobs | { while read -r a b; do echo " $a"; done; } )
|
comps=$( __systemctl $mode list-jobs | { while read -r a b; do echo " $a"; done; } )
|
||||||
|
|
||||||
elif [ "$verb" = 'unset-environment' ]; then
|
elif [ "$verb" = 'unset-environment' ]; then
|
||||||
comps=$( __systemctl $mode show-environment |
|
comps=$( __systemctl $mode show-environment \
|
||||||
while read -r line; do echo " ${line%%=*}"; done )
|
| while read -r line; do echo " ${line%%=*}"; done )
|
||||||
compopt -o nospace
|
compopt -o nospace
|
||||||
|
|
||||||
elif [ "$verb" = 'set-environment' ]; then
|
elif [ "$verb" = 'set-environment' ]; then
|
||||||
comps=$( __systemctl $mode show-environment |
|
comps=$( __systemctl $mode show-environment \
|
||||||
while read -r line; do echo " ${line%%=*}="; done )
|
| while read -r line; do echo " ${line%%=*}="; done )
|
||||||
compopt -o nospace
|
compopt -o nospace
|
||||||
|
|
||||||
elif [ "$verb" = 'import-environment' ]; then
|
elif [ "$verb" = 'import-environment' ]; then
|
||||||
@ -365,8 +365,8 @@ _systemctl () {
|
|||||||
compopt -o filenames
|
compopt -o filenames
|
||||||
|
|
||||||
elif __contains_word "$verb" ${VERBS[TARGETS]}; then
|
elif __contains_word "$verb" ${VERBS[TARGETS]}; then
|
||||||
comps=$( __systemctl $mode list-unit-files --type target --full --all "$cur*" |
|
comps=$( __systemctl $mode list-unit-files --type target --full --all "$cur*" \
|
||||||
{ while read -r a b; do echo " $a"; done; } )
|
| { while read -r a b; do echo " $a"; done; } )
|
||||||
elif __contains_word "$verb" ${VERBS[LOG_LEVEL]}; then
|
elif __contains_word "$verb" ${VERBS[LOG_LEVEL]}; then
|
||||||
comps='debug info notice warning err crit alert emerg'
|
comps='debug info notice warning err crit alert emerg'
|
||||||
elif __contains_word "$verb" ${VERBS[LOG_TARGET]}; then
|
elif __contains_word "$verb" ${VERBS[LOG_TARGET]}; then
|
||||||
|
@ -28,24 +28,24 @@ __contains_word () {
|
|||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
{ while read -r a b; do echo " $a"; done; } |
|
{ while read a b; do echo " $a"; done; } | \
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_units_all() {
|
__get_units_all() {
|
||||||
systemctl list-units --no-legend --no-pager --plain --all $1 2>/dev/null |
|
systemctl list-units --no-legend --no-pager --plain --all $1 | \
|
||||||
{ while read -r a b c; do echo " $a"; done; }
|
{ while read -r a b c; do echo " $a"; done }
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_services() {
|
__get_services() {
|
||||||
systemctl list-units --no-legend --no-pager --plain -t service --all $1 2>/dev/null |
|
systemctl list-units --no-legend --no-pager --plain -t service --all $1 | \
|
||||||
{ while read -r a b c; do [[ $b == "loaded" ]] && echo " $a"; done; }
|
{ while read -r a b c; do [[ $b == "loaded" ]]; echo " $a"; done }
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_syscall_sets() {
|
__get_syscall_sets() {
|
||||||
local line
|
local line
|
||||||
systemd-analyze syscall-filter --no-pager 2>/dev/null | while IFS= read -r line; do
|
systemd-analyze syscall-filter --no-pager | while IFS= read -r line; do
|
||||||
if [[ $line == @* ]]; then
|
if [[ $line == @* ]]; then
|
||||||
printf '%s\n' "$line"
|
printf '%s\n' "$line"
|
||||||
fi
|
fi
|
||||||
@ -53,7 +53,7 @@ __get_syscall_sets() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__get_architectures() {
|
__get_architectures() {
|
||||||
systemd-analyze --no-legend --no-pager architectures 2>/dev/null | { while read -r a b; do echo " $a"; done; }
|
systemd-analyze --no-legend --no-pager architectures | { while read -r a b; do echo " $a"; done }
|
||||||
}
|
}
|
||||||
|
|
||||||
_systemd_analyze() {
|
_systemd_analyze() {
|
||||||
@ -163,7 +163,7 @@ _systemd_analyze() {
|
|||||||
if [[ $cur = -* ]]; then
|
if [[ $cur = -* ]]; then
|
||||||
comps='--help --version --system --user --global --man=no --generators=yes --root --image --recursive-errors=no --recursive-errors=yes --recursive-errors=one'
|
comps='--help --version --system --user --global --man=no --generators=yes --root --image --recursive-errors=no --recursive-errors=yes --recursive-errors=one'
|
||||||
else
|
else
|
||||||
comps=$( compgen -A file -- "$cur"
|
comps=$( compgen -A file -- "$cur";
|
||||||
__get_units_all $mode )
|
__get_units_all $mode )
|
||||||
compopt -o filenames
|
compopt -o filenames
|
||||||
fi
|
fi
|
||||||
|
@ -26,17 +26,17 @@ __contains_word() {
|
|||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
{ while read -r a b; do echo " $a"; done; } |
|
{ while read a b; do echo " $a"; done; } | \
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_units_have_cgroup() {
|
__get_units_have_cgroup() {
|
||||||
systemctl $1 --full --no-legend --no-pager --plain list-units 2>/dev/null | {
|
systemctl $1 --full --no-legend --no-pager --plain list-units | {
|
||||||
while read -r a b c d; do
|
while read -r a b c d; do
|
||||||
[[ $c == "active" && ${a##*.} =~ (service|socket|mount|swap|slice|scope) ]] && echo " $a"
|
[[ $c == "active" && ${a##*.} =~ (service|socket|mount|swap|slice|scope) ]] && echo " $a"
|
||||||
done
|
done
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
_systemd_cgls() {
|
_systemd_cgls() {
|
||||||
|
@ -26,8 +26,8 @@ __contains_word() {
|
|||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
{ while read -r a b; do echo " $a"; done; } |
|
{ while read a b; do echo " $a"; done; } | \
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,15 +26,15 @@ __contains_word() {
|
|||||||
|
|
||||||
__get_tpm2_devices() {
|
__get_tpm2_devices() {
|
||||||
local a b c
|
local a b c
|
||||||
systemd-creds --no-legend --quiet --tpm2-device=list 2>/dev/null |
|
systemd-creds --no-legend --quiet --tpm2-device=list 2>/dev/null | \
|
||||||
{ while read -r a b c; do echo " $a"; done; }
|
{ while read -r a b c; do echo " $a"; done }
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_creds() {
|
__get_creds() {
|
||||||
local a b c
|
local a b c
|
||||||
local mode=$1; shift 1
|
local mode=$1; shift 1
|
||||||
systemd-creds list $mode --no-legend --no-pager $1 2>/dev/null |
|
systemd-creds list $mode --no-legend --no-pager $1 2>/dev/null | \
|
||||||
{ while read -r a b c; do echo " $a"; done; }
|
{ while read -r a b c; do echo " $a"; done }
|
||||||
}
|
}
|
||||||
|
|
||||||
_systemd_creds() {
|
_systemd_creds() {
|
||||||
|
@ -26,26 +26,24 @@ __contains_word() {
|
|||||||
|
|
||||||
__get_users() {
|
__get_users() {
|
||||||
local a b
|
local a b
|
||||||
loginctl list-users --no-legend --no-pager 2>/dev/null |
|
loginctl list-users --no-legend --no-pager | { while read a b; do echo " $b"; done; };
|
||||||
{ while read -r a b; do echo " $b"; done; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_slices() {
|
__get_slices() {
|
||||||
local a b
|
local a b
|
||||||
systemctl list-units -t slice --no-legend --no-pager --plain 2>/dev/null |
|
systemctl list-units -t slice --no-legend --no-pager --plain | { while read a b; do echo " $a"; done; };
|
||||||
{ while read -r a b; do echo " $a"; done; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
{ while read -r a b; do echo " $a"; done; } |
|
{ while read a b; do echo " $a"; done; } | \
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_env() {
|
__get_env() {
|
||||||
local a
|
local a
|
||||||
env | { while read -r a; do [[ $a =~ ^[A-Za-z0-9_]+= ]] && echo " ${a%%=*}"; done; }
|
env | { while read a; do echo " ${a%%=*}"; done; };
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_interfaces(){
|
__get_interfaces(){
|
||||||
|
@ -26,7 +26,7 @@ __contains_word () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__get_names() {
|
__get_names() {
|
||||||
systemd-path 2>/dev/null | { while IFS=: read -r a b; do echo " $a"; done; }
|
systemd-path | { while IFS=: read -r a b; do echo " $a"; done; }
|
||||||
}
|
}
|
||||||
|
|
||||||
_systemd_path() {
|
_systemd_path() {
|
||||||
|
@ -50,7 +50,7 @@ _systemd-resolve() {
|
|||||||
comps=$( __get_interfaces )
|
comps=$( __get_interfaces )
|
||||||
;;
|
;;
|
||||||
--protocol|-p|--type|-t|--class|-c)
|
--protocol|-p|--type|-t|--class|-c)
|
||||||
comps=$( systemd-resolve --legend=no "$prev" help 2>/dev/null; echo help )
|
comps=$( systemd-resolve --legend=no "$prev" help; echo help )
|
||||||
;;
|
;;
|
||||||
--raw)
|
--raw)
|
||||||
comps="payload packet"
|
comps="payload packet"
|
||||||
|
@ -22,8 +22,8 @@ __systemctl() {
|
|||||||
systemctl $mode --full --no-legend --no-pager --plain "$@"
|
systemctl $mode --full --no-legend --no-pager --plain "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_slice_units () { __systemctl $1 list-units --all -t slice 2>/dev/null |
|
__get_slice_units () { __systemctl $1 list-units --all -t slice \
|
||||||
{ while read -r a b c d; do echo " $a"; done; }; }
|
| { while read -r a b c d; do echo " $a"; done; }; }
|
||||||
|
|
||||||
__get_properties () {
|
__get_properties () {
|
||||||
systemd-analyze transient-settings scope service 2>/dev/null |
|
systemd-analyze transient-settings scope service 2>/dev/null |
|
||||||
@ -31,7 +31,7 @@ __get_properties () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__get_path_properties () {
|
__get_path_properties () {
|
||||||
systemd-analyze transient-settings path 2>/dev/null |
|
systemd-analyze transient-settings path |
|
||||||
while read -r p; do [ -z "$p" ] || echo "$p="; done
|
while read -r p; do [ -z "$p" ] || echo "$p="; done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,8 +47,8 @@ __get_timer_properties () {
|
|||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
{ while read -r a b; do echo " $a"; done; } |
|
{ while read -r a b; do echo " $a"; done; } | \
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@ __contains_word () {
|
|||||||
|
|
||||||
__get_machines() {
|
__get_machines() {
|
||||||
local a b
|
local a b
|
||||||
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
{ while read -r a b; do echo " $a"; done; } |
|
{ while read a b; do echo " $a"; done; } | \
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ __get_all_device_nodes() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__get_all_device_units() {
|
__get_all_device_units() {
|
||||||
systemctl list-units -t device --full --no-legend --no-pager --plain 2>/dev/null |
|
systemctl list-units -t device --full --no-legend --no-pager --plain 2>/dev/null | \
|
||||||
{ while read -r a b; do echo "$a"; done; }
|
{ while read -r a b; do echo "$a"; done; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,12 +28,12 @@ __contains_word () {
|
|||||||
|
|
||||||
__get_all_users () {
|
__get_all_users () {
|
||||||
local a b
|
local a b
|
||||||
userdbctl user --no-legend -B 2>/dev/null | { while read -r a b; do printf "%s\n" "$a"; done; }
|
userdbctl user --no-legend -B | { while read -r a b; do printf "%s\n" "$a"; done; }
|
||||||
}
|
}
|
||||||
|
|
||||||
__get_all_groups () {
|
__get_all_groups () {
|
||||||
local a b
|
local a b
|
||||||
userdbctl group --no-legend -B 2>/dev/null | { while read -r a b; do printf "%s\n" "$a"; done; }
|
userdbctl group --no-legend -B | { while read -r a b; do printf "%s\n" "$a"; done; }
|
||||||
}
|
}
|
||||||
|
|
||||||
_userdbctl () {
|
_userdbctl () {
|
||||||
|
@ -8,7 +8,7 @@ __bootctl() {
|
|||||||
_bootctl_comp_ids() {
|
_bootctl_comp_ids() {
|
||||||
local expl
|
local expl
|
||||||
local -a ids
|
local -a ids
|
||||||
__bootctl list | while read -r a b; do
|
__bootctl list | while read a b; do
|
||||||
if [[ "$a" == "id:" ]]; then
|
if [[ "$a" == "id:" ]]; then
|
||||||
ids+="$b"
|
ids+="$b"
|
||||||
fi
|
fi
|
||||||
|
@ -87,7 +87,7 @@ __dbus_matchspec() {
|
|||||||
local -a bus_names
|
local -a bus_names
|
||||||
local NAME OTHER
|
local NAME OTHER
|
||||||
__busctl --unique list |
|
__busctl --unique list |
|
||||||
while read -r NAME OTHER; do
|
while read NAME OTHER; do
|
||||||
echo $NAME
|
echo $NAME
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -104,7 +104,7 @@ __dbus_matchspec() {
|
|||||||
{
|
{
|
||||||
local NAME TYPE OTHER
|
local NAME TYPE OTHER
|
||||||
__busctl introspect "$1" "$2" |
|
__busctl introspect "$1" "$2" |
|
||||||
while read -r NAME TYPE OTHER; do
|
while read NAME TYPE OTHER; do
|
||||||
if [[ ${TYPE} == "interface" ]]; then
|
if [[ ${TYPE} == "interface" ]]; then
|
||||||
echo ${NAME}
|
echo ${NAME}
|
||||||
fi
|
fi
|
||||||
@ -117,7 +117,7 @@ __dbus_matchspec() {
|
|||||||
local required="$5"
|
local required="$5"
|
||||||
local NAME TYPE SIGNATURE VALUE FLAGS
|
local NAME TYPE SIGNATURE VALUE FLAGS
|
||||||
__busctl introspect "$1" "$2" "$3" |
|
__busctl introspect "$1" "$2" "$3" |
|
||||||
while read -r NAME TYPE SIGNATURE VALUE FLAGS; do
|
while read NAME TYPE SIGNATURE VALUE FLAGS; do
|
||||||
[[ -z "$member" || ${TYPE} == "$member" ]] &&
|
[[ -z "$member" || ${TYPE} == "$member" ]] &&
|
||||||
[[ -z "$required" || "${${(os: :)FLAGS}}" == $~required ]] &&
|
[[ -z "$required" || "${${(os: :)FLAGS}}" == $~required ]] &&
|
||||||
echo ${NAME#.}
|
echo ${NAME#.}
|
||||||
@ -128,7 +128,7 @@ __dbus_matchspec() {
|
|||||||
{
|
{
|
||||||
local NAME TYPE SIGNATURE VALUE FLAGS
|
local NAME TYPE SIGNATURE VALUE FLAGS
|
||||||
__busctl introspect "$1" "$2" "$3" |
|
__busctl introspect "$1" "$2" "$3" |
|
||||||
while read -r NAME TYPE SIGNATURE VALUE FLAGS; do
|
while read NAME TYPE SIGNATURE VALUE FLAGS; do
|
||||||
if [[ ${NAME#.} == "$4" ]]; then
|
if [[ ${NAME#.} == "$4" ]]; then
|
||||||
[[ ${SIGNATURE} != "-" ]] && echo ${SIGNATURE}
|
[[ ${SIGNATURE} != "-" ]] && echo ${SIGNATURE}
|
||||||
fi
|
fi
|
||||||
|
@ -17,7 +17,7 @@ _coredumpctl_commands(){
|
|||||||
local -a _dumps
|
local -a _dumps
|
||||||
cmd="${${_coredumpctl_cmds[(r)$words[1]:*]%%:*}}"
|
cmd="${${_coredumpctl_cmds[(r)$words[1]:*]%%:*}}"
|
||||||
if (( $#cmd )); then
|
if (( $#cmd )); then
|
||||||
_dumps=( "${(f)$(coredumpctl list -q --no-legend 2>/dev/null | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $4,$0}')}" )
|
_dumps=( "${(f)$(coredumpctl list -q --no-legend | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $4,$0}' 2>/dev/null)}" )
|
||||||
if [[ -n "$_dumps" ]]; then
|
if [[ -n "$_dumps" ]]; then
|
||||||
_describe -V -t pids 'coredumps' _dumps
|
_describe -V -t pids 'coredumps' _dumps
|
||||||
else
|
else
|
||||||
|
@ -12,7 +12,7 @@ _kernel-install_images(){
|
|||||||
|
|
||||||
(( $+functions[_kernel-install_kernels] )) ||
|
(( $+functions[_kernel-install_kernels] )) ||
|
||||||
_kernel-install_kernels(){
|
_kernel-install_kernels(){
|
||||||
read -r _MACHINE_ID < /etc/machine-id
|
read _MACHINE_ID < /etc/machine-id
|
||||||
_kernel=( /lib/modules/[0-9]* )
|
_kernel=( /lib/modules/[0-9]* )
|
||||||
if [[ "$cmd" == "remove" && -n "$_MACHINE_ID" ]]; then
|
if [[ "$cmd" == "remove" && -n "$_MACHINE_ID" ]]; then
|
||||||
_kernel=( "/boot/$_MACHINE_ID"/[0-9]* )
|
_kernel=( "/boot/$_MACHINE_ID"/[0-9]* )
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
(( $+functions[_localectl_set-locale] )) ||
|
(( $+functions[_localectl_set-locale] )) ||
|
||||||
_localectl_set-locale() {
|
_localectl_set-locale() {
|
||||||
local -a _locales locale_fields
|
local -a _locales locale_fields
|
||||||
locale_fields=(LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME
|
locale_fields=(LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME \
|
||||||
LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER
|
LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER \
|
||||||
LC_NAME LC_ADDRESS LC_TELEPHONE
|
LC_NAME LC_ADDRESS LC_TELEPHONE \
|
||||||
LC_MEASUREMENT LC_IDENTIFICATION)
|
LC_MEASUREMENT LC_IDENTIFICATION)
|
||||||
# LC_ALL is omitted on purpose
|
# LC_ALL is omitted on purpose
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
(( $+functions[_loginctl_all_sessions] )) ||
|
(( $+functions[_loginctl_all_sessions] )) ||
|
||||||
_loginctl_all_sessions() {
|
_loginctl_all_sessions() {
|
||||||
local session description
|
local session description
|
||||||
loginctl --no-legend list-sessions 2>/dev/null | while read -r session description; do
|
loginctl --no-legend list-sessions | while read -r session description; do
|
||||||
_sys_all_sessions+=( "$session" )
|
_sys_all_sessions+=( "$session" )
|
||||||
_sys_all_sessions_descr+=( "${session}:$description" )
|
_sys_all_sessions_descr+=( "${session}:$description" )
|
||||||
done
|
done
|
||||||
@ -13,7 +13,7 @@ _loginctl_all_sessions() {
|
|||||||
(( $+functions[_loginctl_all_users] )) ||
|
(( $+functions[_loginctl_all_users] )) ||
|
||||||
_loginctl_all_users() {
|
_loginctl_all_users() {
|
||||||
local uid description
|
local uid description
|
||||||
loginctl --no-legend list-users 2>/dev/null | while read -r uid description; do
|
loginctl --no-legend list-users | while read -r uid description; do
|
||||||
_sys_all_users+=( "$uid" )
|
_sys_all_users+=( "$uid" )
|
||||||
_sys_all_users_descr+=( "${uid}:$description" )
|
_sys_all_users_descr+=( "${uid}:$description" )
|
||||||
done
|
done
|
||||||
@ -22,7 +22,7 @@ _loginctl_all_users() {
|
|||||||
(( $+functions[_loginctl_all_seats] )) ||
|
(( $+functions[_loginctl_all_seats] )) ||
|
||||||
_loginctl_all_seats() {
|
_loginctl_all_seats() {
|
||||||
local seat description
|
local seat description
|
||||||
loginctl --no-legend list-seats 2>/dev/null | while read -r seat description; do
|
loginctl --no-legend list-seats | while read -r seat description; do
|
||||||
_sys_all_seats+=( "$seat" )
|
_sys_all_seats+=( "$seat" )
|
||||||
_sys_all_seats_descr+=( "${seat}:$description" )
|
_sys_all_seats_descr+=( "${seat}:$description" )
|
||||||
done
|
done
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
__machinectl_get_images () {
|
__machinectl_get_images () {
|
||||||
local -a flags
|
local -a flags
|
||||||
if [[ $PREFIX == .* ]]; then flags=( --all ); fi
|
if [[ $PREFIX == .* ]]; then flags=( --all ); fi
|
||||||
machinectl --no-legend list-images $flags 2>/dev/null | {while read -r a b; do
|
machinectl --no-legend list-images $flags | {while read -r a b; do
|
||||||
# escape : and \; do not interpret existing escape sequences
|
# escape : and \; do not interpret existing escape sequences
|
||||||
printf -- "%s\n" ${a//(#b)(\\|:)/\\$match}
|
printf -- "%s\n" ${a//(#b)(\\|:)/\\$match}
|
||||||
done;}
|
done;}
|
||||||
|
@ -19,21 +19,21 @@
|
|||||||
(( $+functions[_resolvectl_protocols] )) ||
|
(( $+functions[_resolvectl_protocols] )) ||
|
||||||
_resolvectl_protocols() {
|
_resolvectl_protocols() {
|
||||||
local -a _protocol
|
local -a _protocol
|
||||||
_protocol=( $(_call_program protocol ${service} --legend=no --protocol help 2>/dev/null; echo help) )
|
_protocol=( $(_call_program protocol ${service} --legend=no --protocol help; echo help) )
|
||||||
_values 'protocol' "$_protocol[@]"
|
_values 'protocol' "$_protocol[@]"
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[_resolvectl_types] )) ||
|
(( $+functions[_resolvectl_types] )) ||
|
||||||
_resolvectl_types() {
|
_resolvectl_types() {
|
||||||
local -a _type
|
local -a _type
|
||||||
_type=( $(_call_program type ${service} --legend=no --type help 2>/dev/null; echo help) )
|
_type=( $(_call_program type ${service} --legend=no --type help; echo help) )
|
||||||
_values 'type' "$_type[@]"
|
_values 'type' "$_type[@]"
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[_resolvectl_classes] )) ||
|
(( $+functions[_resolvectl_classes] )) ||
|
||||||
_resolvectl_classes() {
|
_resolvectl_classes() {
|
||||||
local -a _class
|
local -a _class
|
||||||
_class=( $(_call_program class ${service} --legend=no --class help 2>/dev/null; echo help) )
|
_class=( $(_call_program class ${service} --legend=no --class help; echo help) )
|
||||||
_values 'class' "$_class[@]"
|
_values 'class' "$_class[@]"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
|
|
||||||
(( $+functions[__sd_machines_get_machines] )) ||
|
(( $+functions[__sd_machines_get_machines] )) ||
|
||||||
__sd_machines_get_machines () {
|
__sd_machines_get_machines () {
|
||||||
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
|
|
||||||
{ while read -r a b; do echo "$a"; done; } |
|
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
|
||||||
|
{ while read a b; do echo "$a"; done; } | \
|
||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,8 +119,8 @@
|
|||||||
while _tags; do
|
while _tags; do
|
||||||
for i in $groups; do
|
for i in $groups; do
|
||||||
if _requested ${i//_/-}-commands; then
|
if _requested ${i//_/-}-commands; then
|
||||||
_describe -t ${i//_/-}-commands "${i//_/ } command" ${i}_commands &&
|
_describe -t ${i//_/-}-commands "${i//_/ } command" ${i}_commands \
|
||||||
ret=0
|
&& ret=0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
@ -162,7 +162,7 @@ __systemctl()
|
|||||||
(( $+functions[_systemctl_all_units] )) ||
|
(( $+functions[_systemctl_all_units] )) ||
|
||||||
_systemctl_all_units()
|
_systemctl_all_units()
|
||||||
{
|
{
|
||||||
if _cache_invalid SYS_ALL_UNITS$_sys_service_mgr || ! _retrieve_cache SYS_ALL_UNITS$_sys_service_mgr
|
if _cache_invalid SYS_ALL_UNITS$_sys_service_mgr || ! _retrieve_cache SYS_ALL_UNITS$_sys_service_mgr;
|
||||||
then
|
then
|
||||||
_sys_all_units=( ${${(f)"$(__systemctl list-units --all)"}%% *} )
|
_sys_all_units=( ${${(f)"$(__systemctl list-units --all)"}%% *} )
|
||||||
_store_cache SYS_ALL_UNITS$_sys_service_mgr _sys_all_units
|
_store_cache SYS_ALL_UNITS$_sys_service_mgr _sys_all_units
|
||||||
@ -173,9 +173,9 @@ __systemctl()
|
|||||||
(( $+functions[_systemctl_really_all_units] )) ||
|
(( $+functions[_systemctl_really_all_units] )) ||
|
||||||
_systemctl_really_all_units()
|
_systemctl_really_all_units()
|
||||||
{
|
{
|
||||||
local -a all_unit_files
|
local -a all_unit_files;
|
||||||
local -a really_all_units
|
local -a really_all_units;
|
||||||
if _cache_invalid SYS_REALLY_ALL_UNITS$_sys_service_mgr || ! _retrieve_cache SYS_REALLY_ALL_UNITS$_sys_service_mgr
|
if _cache_invalid SYS_REALLY_ALL_UNITS$_sys_service_mgr || ! _retrieve_cache SYS_REALLY_ALL_UNITS$_sys_service_mgr;
|
||||||
then
|
then
|
||||||
all_unit_files=( ${${(f)"$(__systemctl list-unit-files)"}%% *} )
|
all_unit_files=( ${${(f)"$(__systemctl list-unit-files)"}%% *} )
|
||||||
_systemctl_all_units
|
_systemctl_all_units
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
(( $+functions[_systemd-analyze_critical-chain] )) ||
|
(( $+functions[_systemd-analyze_critical-chain] )) ||
|
||||||
_systemd-analyze_critical-chain() {
|
_systemd-analyze_critical-chain() {
|
||||||
local -a _units
|
local -a _units
|
||||||
systemctl list-units --no-legend --no-pager --plain --all 2>/dev/null |
|
systemctl list-units --no-legend --no-pager --plain --all |
|
||||||
while read -r a b c; do
|
while read -r a b c; do
|
||||||
_units+=($a)
|
_units+=($a)
|
||||||
done
|
done
|
||||||
@ -29,14 +29,14 @@
|
|||||||
(( $+functions[_systemd-analyze_syscall-filter] )) ||
|
(( $+functions[_systemd-analyze_syscall-filter] )) ||
|
||||||
_systemd-analyze_syscall-filter() {
|
_systemd-analyze_syscall-filter() {
|
||||||
local -a _groups
|
local -a _groups
|
||||||
_groups=( $(systemd-analyze --quiet --no-pager syscall-filter 2>/dev/null | grep '^@') )
|
_groups=( $(systemd-analyze --quiet --no-pager syscall-filter | grep '^@') )
|
||||||
_describe -t groups 'syscall groups' _groups || compadd "$@"
|
_describe -t groups 'syscall groups' _groups || compadd "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[_systemd-analyze_filesystems] )) ||
|
(( $+functions[_systemd-analyze_filesystems] )) ||
|
||||||
_systemd-analyze_filesystems() {
|
_systemd-analyze_filesystems() {
|
||||||
local -a _groups
|
local -a _groups
|
||||||
_groups=( $(systemd-analyze --quiet --no-pager filesystems 2>/dev/null | grep '^@') )
|
_groups=( $(systemd-analyze --quiet --no-pager filesystems | grep '^@') )
|
||||||
_describe -t groups 'file system groups' _groups || compadd "$@"
|
_describe -t groups 'file system groups' _groups || compadd "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,7 +50,7 @@
|
|||||||
(( $+functions[_systemd-analyze_transient-settings] )) ||
|
(( $+functions[_systemd-analyze_transient-settings] )) ||
|
||||||
_systemd-analyze_transient-settings() {
|
_systemd-analyze_transient-settings() {
|
||||||
local -a _types
|
local -a _types
|
||||||
_types=( $(systemctl --no-pager --no-legend -t help 2>/dev/null) )
|
_types=( $(systemctl --no-pager --no-legend -t help) )
|
||||||
_describe -t types 'unit types' _types
|
_describe -t types 'unit types' _types
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +62,8 @@
|
|||||||
'time:Print time spent in the kernel before reaching userspace'
|
'time:Print time spent in the kernel before reaching userspace'
|
||||||
'blame:Print list of running units ordered by time to init'
|
'blame:Print list of running units ordered by time to init'
|
||||||
'critical-chain:Print a tree of the time critical chain of units'
|
'critical-chain:Print a tree of the time critical chain of units'
|
||||||
'plot:Output SVG graphic showing service initialization, or raw time data in JSON or table format'
|
'plot:Output SVG graphic showing service initialization, or raw time data in
|
||||||
|
JSON or table format'
|
||||||
'dot:Dump dependency graph (in dot(1) format)'
|
'dot:Dump dependency graph (in dot(1) format)'
|
||||||
'dump:Dump server status'
|
'dump:Dump server status'
|
||||||
'cat-config:Cat systemd config files'
|
'cat-config:Cat systemd config files'
|
||||||
|
@ -10,8 +10,8 @@ __systemctl() {
|
|||||||
|
|
||||||
(( $+functions[__systemd-run_get_slices] )) ||
|
(( $+functions[__systemd-run_get_slices] )) ||
|
||||||
__systemd-run_get_slices () {
|
__systemd-run_get_slices () {
|
||||||
__systemctl list-units --all -t slice |
|
__systemctl list-units --all -t slice \
|
||||||
{ while read -r a b; do echo $a; done; }
|
| { while read -r a b; do echo $a; done; };
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__systemd-run_slices] )) ||
|
(( $+functions[__systemd-run_slices] )) ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user