switch-systemd-unit
v1.1.0
Published
a cli tool for switching systemd unit quickly
Downloads
3
Readme
switch-systemd-unit
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: "[email protected]"
# --dir: directory for reading unit instance name
# --extname: extname of instance files, default: ""
Example
[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 [email protected] --extname .json
or just use JSON config /path/to/config.json
:
{
"extname": ".json",
"dir": "/etc/my-config",
"template": "[email protected]"
}
$ switch-unit -c /path/to/config.json