Skip to content

Instantly share code, notes, and snippets.

@diversemix
Created June 8, 2016 14:45
Show Gist options
  • Save diversemix/19d18b603aeea3dc6f7ba23964b88c68 to your computer and use it in GitHub Desktop.
Save diversemix/19d18b603aeea3dc6f7ba23964b88c68 to your computer and use it in GitHub Desktop.
Installing a service from scripts.
#!/bin/bash
set -x
systemctl stop $1
systemctl disable $1
systemctl daemon-reload
systemctl reset-failed
systemctl status $1 && exit 1
ls -l /etc/systemd/system/$1*
systemctl enable $PWD/$1.service
systemctl start $1
systemctl status $1
netstat -lpn | grep 22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment