diff --git a/Cargo.toml b/Cargo.toml index 2e5464e..6771387 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" @@ -43,3 +43,5 @@ strip = "symbols" [package.metadata.deb] copyright = "2023 Spencer Woo" +maintainer-scripts = "debian/" +systemd-units = { enable = true, start = false } diff --git a/README.md b/README.md index e89bcbf..77e4bb2 100644 --- a/README.md +++ b/README.md @@ -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 .deb` +- `sudo apt install ./.deb` +- Start `bitsrun.service` if desired: edit `/lib/systemd/system/bitsrun.service` to specify absolute config path, then `sudo systemctl start bitsrun` #### Cargo diff --git a/debian/bitsrun.service b/debian/bitsrun.service new file mode 100644 index 0000000..a461b32 --- /dev/null +++ b/debian/bitsrun.service @@ -0,0 +1,11 @@ +[Unit] +Description=bitsrun - A headless login and logout CLI for 10.0.0.55 at BIT +After=network.target + +[Service] +Type=simple +Restart=on-abort +ExecStart=/usr/bin/bitsrun keep-alive --config /path/to/bit-user.json + +[Install] +WantedBy=multi-user.target