Browse Source

Add scripts

main
Johannes Wünsche 6 months ago
parent
commit
12cc364d79
Signed by: johannes
GPG Key ID: 2511CF80B7C283AB
  1. 5
      README.md
  2. 16
      scripts/install.sh
  3. 18
      scripts/uninstall.sh

5
README.md

@ -117,11 +117,10 @@ $ cargo install --path .
or to any other arbitrary directory in your `$PATH` e.g. `/usr/local/bin`
``` sh
$ cargo build --release
$ install -Dm755 "target/release/enkei" "/usr/local/bin/enkei"
$ install -Dm755 "target/release/enkeictl" "/usr/local/bin/enkeictl"
$ ./scripts/install.sh --prefix "/usr/local/bin"
```
> By default the `install.sh` script uses `/usr/bin`
### Using as a systemd-service

16
scripts/install.sh

@ -0,0 +1,16 @@
#!/bin/env sh
set -e
# Default prefix
PREFIX=/usr/bin
if [ "$1" = '--prefix' ]
then
PREFIX=$2
fi
cargo build --release
install -Dm755 target/release/enkei "${PREFIX}/enkei"
install -Dm755 target/release/enkeictl "${PREFIX}/enkeictl"

18
scripts/uninstall.sh

@ -0,0 +1,18 @@
#!/bin/env sh
set -e
# Default prefix
PREFIX=/usr/bin
if [ "$1" = '--prefix' ]
then
PREFIX=$2
else
echo 'If a non-standard $PREFIX has been used to install please specify it here also.'
fi
rm "${PREFIX}/enkei"
rm "${PREFIX}/enkeictl"
Loading…
Cancel
Save