diff --git a/doc/overview.edoc b/doc/overview.edoc index 752870fd1..111fd8de8 100644 --- a/doc/overview.edoc +++ b/doc/overview.edoc @@ -57,13 +57,10 @@ file shipped with eturnal's source code archive. -The binary release is installed using the following commands (on AArch64 -systems, `x64' must be replaced with `arm64'): +The binary release is installed using the following command line: ``` -curl -O https://eturnal.net/eturnal-1.11.1-linux-x64.run -chmod +x eturnal-1.11.1-linux-x64.run -sudo ./eturnal-1.11.1-linux-x64.run +curl -fsS https://eturnal.net/install | sudo sh ''' The installer extracts the release archive into `/opt/eturnal' and creates a @@ -71,7 +68,7 @@ system user called `eturnal'. An example configuration is installed as `/etc/eturnal.yml' if that file doesn't exist yet. On systemd-managed systems, a service unit is created and eturnal is started. -If the above commands were used to upgrade eturnal from an earlier version, the +If the above command was used to upgrade eturnal from an earlier version, the service must be restarted afterwards. On systemd-managed systems: ``` @@ -82,9 +79,7 @@ For uninstalling eturnal and removing the configuration, run the following commands: ``` -sudo systemctl --now disable eturnal -sudo rm -rf /opt/eturnal -sudo rm /etc/systemd/system/eturnal.service +curl -fsS https://eturnal.net/uninstall | sudo sh sudo rm /etc/eturnal.yml ''' diff --git a/tools/publish-release b/tools/publish-release index 6cb653e0b..3015cc5ac 100755 --- a/tools/publish-release +++ b/tools/publish-release @@ -77,3 +77,55 @@ do done createrepo_c "$rpm_repo_dir" gpg --detach-sign --armor "$rpm_repo_dir/repodata/repomd.xml" + +cat >"$web_root_dir/install" <<-EOF + #!/bin/sh + set -e + set -u + rel_name='$rel_name' + rel_vsn='$rel_vsn' + os='linux' + platform="\$(uname -s)/\$(uname -m)" + domain="\$rel_name.net" + tmp_dir=\$(mktemp -d "\$rel_name.XXXXXX") + trap 'rm -rf "\$tmp_dir"' INT TERM EXIT + unsupported() + { + echo >&2 "No \$rel_name binaries available for \$1 systems." + echo >&2 + echo >&2 "For building \$rel_name from source, see:" + echo >&2 + echo >&2 "https://\$domain/documentation/code/install.html" + exit 1 + } + case \$platform in + Linux/aarch64) arch='arm64' ;; + Linux/x86_64) arch='x64' ;; + *) unsupported "\$platform" ;; + esac + if ! ldd --version 2>'/dev/null' | grep -qiE '(GNU libc|GLIBC)' + then unsupported 'non-glibc' + fi + installer="\$rel_name-\$rel_vsn-\$os-\$arch.run" + url="https://\$domain/\$installer" + cd "\$tmp_dir" + if type curl >'/dev/null' + then curl -fsSLO "\$url" + else wget --quiet "\$url" + fi + chmod +x "\$installer" + ./\$installer + cd "\$OLDPWD" +EOF +cat >"$web_root_dir/uninstall" <<-'EOF' + #!/bin/sh + set -e + set -u + if [ -e '/run/systemd/system' ] + then + systemctl --now disable eturnal + rm -f /etc/systemd/system/eturnal.service + fi + rm -rf /opt/eturnal + echo 'eturnal has been uninstalled successfully.' +EOF