Skip to content

Commit

Permalink
systemd unit files support
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerwooo committed Dec 4, 2023
1 parent a5956c7 commit ffbb310
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bitsrun"
description = "A headless login and logout CLI for 10.0.0.55 at BIT"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
license = "MIT"
homepage = "https://github.com/spencerwooo/bitsrun-rs"
Expand Down Expand Up @@ -43,3 +43,4 @@ strip = "symbols"

[package.metadata.deb]
copyright = "2023 Spencer Woo"
maintainer-scripts = "debian/"
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![GitHub release (with filter)](https://img.shields.io/github/v/release/spencerwooo/bitsrun-rs)](https://github.com/spencerwooo/bitsrun-rs/releases/latest)
[![Crates.io](https://img.shields.io/crates/v/bitsrun?color=rgb(221%2C%20170%2C%2071))](https://crates.io/crates/bitsrun)

๐ŸŒ A headless login and logout CLI app for 10.0.0.55 at BIT, now in Rust.
๐ŸŒ A headless login and logout CLI for 10.0.0.55 at BIT, now in Rust.

![screenshot](https://github.com/spencerwooo/bitsrun-rs/assets/32114380/011e7591-1474-4df8-a371-7a9da7629959)

Expand All @@ -15,10 +15,11 @@

- `curl -fsSL https://cdn.jsdelivr.net/gh/spencerwooo/bitsrun-rs@main/install.sh | sh -`

#### Ubuntu / Debian
#### Ubuntu / Debian (recommended for `systemd` support)

- Download the latest `.deb` package from [Releases](https://github.com/spencerwooo/bitsrun-rs/releases/latest).
- `sudo dpkg -i <file>.deb`
- `sudo apt install ./<path/to/file>.deb`
- Start `[email protected]` if desired: `sudo systemctl start bitsrun`

#### Cargo

Expand Down Expand Up @@ -54,6 +55,19 @@ bitsrun: <ip> (<username>) is online
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

To keep the session alive, use `bitsrun keep-alive`:

```console
$ bitsrun keep-alive
INFO bitsrun::daemon > starting daemon (<username>) with polling interval=3600s
INFO bitsrun::daemon > <ip> (<username>): login success,
...
^C INFO bitsrun::daemon > <username>: gracefully exiting
```

> [!NOTE]
> Use available system service managers to run `bitsrun keep-alive` as a daemon. (e.g., `systemd` for Linux, `launchd` for macOS, and Windows Service for Windows).
## Available commands

```console
Expand Down
12 changes: 12 additions & 0 deletions debian/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=A headless login and logout CLI for 10.0.0.55 at BIT (%i).
After=network.target

[Service]
Type=simple
User=%i
Restart=on-abort
ExecStart=/usr/bin/bitsrun keep-alive

[Install]
WantedBy=multi-user.target

0 comments on commit ffbb310

Please sign in to comment.