Added debian check, to provide functions only on debian systems.
This commit is contained in:
parent
1c00eadb7b
commit
13caedb7b1
@ -113,6 +113,8 @@ list-ssh-keys() {
|
||||
done
|
||||
}
|
||||
|
||||
{{ if eq .chezmoi.os "linux" }}
|
||||
{{ if eq .chezmoi.osRelease.id "debian" }}
|
||||
# Show version of a Debian package
|
||||
debversion() {
|
||||
if [ -x dpkg ]; then
|
||||
@ -135,6 +137,20 @@ deblist() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Show apt installation history
|
||||
debhistory() {
|
||||
zcat /var/log/apt/history.log.*.gz | \
|
||||
/usr/bin/cat - /var/log/apt/history.log | \
|
||||
grep -Po '^Commandline:(?= apt)(?=.* install ) \K.*|^Start-Date: \K.*' | \
|
||||
grep -B1 "^apt" | \
|
||||
grep -v -- "^--" | \
|
||||
paste -d " " - - | \
|
||||
sort
|
||||
}
|
||||
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
# Run 'top' by a list of processes matching name.
|
||||
topby() {
|
||||
local name=${1:?name required}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user