switch-systemd-unit

1.1.0 • Public • Published

switch-systemd-unit

version

a cli tool for switching systemd unit more quickly

Install

$ npm i -g switch-systemd-unit

Usage

$ switch-unit -h
 
# Usage: switch-unit 
#   -h, --help:     show this 
#   -c, --config:   config file for options below, default: "/etc/switch-systemd-unit.json" 
#   -t, --template: systemd unit template name, format: "name@.suffix" 
#   --dir:          directory for reading unit instance name 
#   --extname:      extname of instance files, default: "" 

Example

xxxx@.service:

[Unit]
Description=xxxxx
After=network.target

[Service]
Type=simple
User=nobody
ExecStart=start-sth -c /etc/my-config/%i.json

[Install]
WantedBy=multi-user.target

corresponding usage

pass arguments directly:

$ switch-unit --dir /etc/my-config --template xxxx@.service --extname .json

or just use JSON config /path/to/config.json:

{
  "extname": ".json",
  "dir": "/etc/my-config",
  "template": "xxxx@.service"
}
$ switch-unit -c /path/to/config.json

LICENSE

ISC

Readme

Keywords

Package Sidebar

Install

npm i switch-systemd-unit

Weekly Downloads

2

Version

1.1.0

License

ISC

Last publish

Collaborators

  • dgeibi