2020-11-03 12:07:49 -08:00
|
|
|
#!/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=
|
|
|
|
}
|
2023-12-14 13:59:24 -08:00
|
|
|
|
|
|
|
function sdeub {
|
|
|
|
loginctl enable-linger
|
|
|
|
}
|
|
|
|
|
|
|
|
function sddub {
|
|
|
|
loginctl disable-linger
|
|
|
|
}
|
|
|
|
|
|
|
|
function sdstub {
|
|
|
|
[[ $(loginctl show-user "$USER" --property=Linger | cut -d= -f2) == 'yes' ]] && echo enabled || echo disabled
|
2024-08-03 14:49:03 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function sdcatg(){
|
|
|
|
systemctl cat "$1" | grep "$2"
|
|
|
|
}
|
|
|
|
|
|
|
|
function sdshg(){
|
|
|
|
systemctl show "$1" | grep "$2"
|
|
|
|
}
|
|
|
|
|
|
|
|
function sdcatug(){
|
|
|
|
systemctl cat --user "$1" | grep "$2"
|
|
|
|
}
|
|
|
|
|
|
|
|
function sdshug(){
|
|
|
|
systemctl show --user "$1" | grep "$2"
|
2023-12-14 13:59:24 -08:00
|
|
|
}
|