Skip to content

Instantly share code, notes, and snippets.

@ageis
Last active August 27, 2017 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ageis/e9043ff9b4fdd9cfe12e7a82b36cba91 to your computer and use it in GitHub Desktop.
Save ageis/e9043ff9b4fdd9cfe12e7a82b36cba91 to your computer and use it in GitHub Desktop.
systemd service unit management in minimal keystrokes.
#!/bin/bash
function stop () {
sudo systemctl stop "$1"
sleep 3s
}
function start () {
sleep 3s
sudo systemctl start "$1"
}
function status () {
sudo systemctl status "$1"
}
function reload () {
sudo systemctl reload "$1"
}
function restart () {
sudo systemctl restart "$1"
}
function viewlog () {
sudo journalctl -e -u "$1"
}
function kicksysd () {
sudo systemctl daemon-reload
sudo systemctl reset-failed
}
function disablesvc () {
sudo systemctl disable "$1"
}
function enablesvc () {
sudo systemctl enable "$1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment