Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dgeibi/switch-systemd-unit
a cli tool for switching systemd unit more quickly
https://github.com/dgeibi/switch-systemd-unit
Last synced: 1 day ago
JSON representation
a cli tool for switching systemd unit more quickly
- Host: GitHub
- URL: https://github.com/dgeibi/switch-systemd-unit
- Owner: dgeibi
- License: isc
- Created: 2018-02-06T16:19:54.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-07T04:37:46.000Z (almost 7 years ago)
- Last Synced: 2024-12-15T00:32:39.478Z (13 days ago)
- Language: JavaScript
- Homepage:
- Size: 85 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# switch-systemd-unit
[![version][version-badge]][package]
a cli tool for switching systemd unit more quickly
## Install
```sh
$ npm i -g switch-systemd-unit
```## Usage
```sh
$ 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: ""
```![](screenshot.png)
## 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:
```sh
$ switch-unit --dir /etc/my-config --template [email protected] --extname .json
```or just use JSON config `/path/to/config.json`:
```json
{
"extname": ".json",
"dir": "/etc/my-config",
"template": "[email protected]"
}
``````sh
$ switch-unit -c /path/to/config.json
```## LICENSE
[ISC](LICENSE)
[version-badge]: https://img.shields.io/npm/v/switch-systemd-unit.svg
[package]: https://www.npmjs.com/package/switch-systemd-unit