# switch-systemd-unit

> a cli tool for switching systemd unit quickly

Latest version **1.1.0** (published 2018-02-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install switch-systemd-unit
pnpm add switch-systemd-unit
yarn add switch-systemd-unit
bun add switch-systemd-unit
```

Provides the command `switch-unit`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2018-02-07 |
| First published | 2018-02-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | dgeibi |
| Maintainers | dgeibi |
| Keywords | systemd |

## Links

- npm: https://www.npmjs.com/package/switch-systemd-unit
- Repository: https://github.com/dgeibi/switch-systemd-unit
- Homepage: https://github.com/dgeibi/switch-systemd-unit#readme
- Issues: https://github.com/dgeibi/switch-systemd-unit/issues
- npm.io page: https://npm.io/package/switch-systemd-unit

## Dependencies (3)

- [ink](https://npm.io/package/ink.md) ^0.4.1
- [mri](https://npm.io/package/mri.md) ^1.1.0
- [ink-select-input](https://npm.io/package/ink-select-input.md) ^1.0.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2018-02-07
- 1.0.1 — 2018-02-06
- 1.0.0 — 2018-02-06

## 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: "name@.suffix"
#   --dir:          directory for reading unit instance name
#   --extname:      extname of instance files, default: ""
```

![](screenshot.png)

## 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:

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

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

```json
{
  "extname": ".json",
  "dir": "/etc/my-config",
  "template": "xxxx@.service"
}
```

```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

---
_Source: https://npm.io/package/switch-systemd-unit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
