Files

35 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# One command on a fresh Linux CUDA machine (or WSL2): verify this release, then hand over to `leleka up`.
#
# tar -xJf leleka-VERSION-linux-x86_64.tar.xz && cd leleka-VERSION-linux-x86_64
# sudo ./install.sh --assets /data/leleka # systemd service, starts at boot
# ./install.sh --assets ~/leleka --foreground # WSL2 without systemd, or a terminal
# ./install.sh --dry-run # print the plan, change nothing
#
# Every option is passed to `leleka up` (see `./bin/leleka --help`). Nothing here needs Python.
set -eu
here=$(cd "$(dirname "$0")" && pwd)
cd "$here"
case "$(uname -s)/$(uname -m)" in
Linux/x86_64) ;;
*) echo "install.sh: this release is for Linux x86_64 (WSL2 included), not $(uname -s)/$(uname -m)" >&2; exit 1 ;;
esac
[ -x ./bin/leleka ] || { echo "install.sh: ./bin/leleka is missing; run this script from the unpacked release directory" >&2; exit 1; }
if [ -f SHA256SUMS ]; then
if command -v sha256sum >/dev/null 2>&1; then
echo "install.sh: verifying the release files against SHA256SUMS ..." >&2
sha256sum --quiet -c SHA256SUMS || {
echo "install.sh: a file does not match SHA256SUMS; download the release again" >&2
exit 1
}
else
echo "install.sh: sha256sum not found, skipping the integrity check" >&2
fi
fi
exec ./bin/leleka up "$@"