This repository has been archived on 2022-02-20. You can view files and clone it, but cannot push or open issues/pull-requests.
bash-shell-base/function/systemd

41 lines
1.1 KiB
Bash

#!/bin/bash
function sdj(){
journalctl -u "$1" | tail -f -n ${2:-50}
}
function sdjf(){
journalctl -f -u "$1"
}
function sdw(){
sdst "$1" | grep Loaded
}
function sdstate () {
echo $1 state
systemctl show --no-page $1 | grep ActiveState
systemctl show --no-page $1 | grep UnitFileState
systemctl show --no-page $1 | grep LoadState
systemctl show --no-page $1 | grep ExecMainPID
systemctl show --no-page $1 | grep ExecMainStartTimestamp=
systemctl show --no-page $1 | grep ExecMainExitTimestamp=
}
function sdju(){
journalctl --user -u "$1" | tail -f -n ${2:-50}
}
function sdjuf(){
journalctl --user -f -u "$1"
}
function sdwu(){
sdstu "$1" | grep Loaded
}
function sdstateu () {
echo $1 state
systemctl --user show --no-page $1 | grep ActiveState
systemctl --user show --no-page $1 | grep UnitFileState
systemctl --user show --no-page $1 | grep LoadState
systemctl --user show --no-page $1 | grep ExecMainPID
systemctl --user show --no-page $1 | grep ExecMainStartTimestamp=
systemctl --user show --no-page $1 | grep ExecMainExitTimestamp=
}