Commit 601d77be authored by cr0n's avatar cr0n
Browse files

necesse-server: add udpate script

parent d30cd067
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ stdenvNoCC.mkDerivation {
    runHook postInstall
  '';

  passthru.updateScript = ./update.sh;

  meta = {
    homepage = "https://necessegame.com/server/";
    description = "Dedicated server for Necesse";
+15 −0
Original line number Diff line number Diff line
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl pup common-updater-scripts

set -eu -o pipefail

version=$(
    curl -s http://www.necessegame.com/server \
        | pup 'a[href*="linux64"] text{}' \
        | awk -F'[v ]' '/Linux64/ {print $4"-"$6}' \
        | sort -Vu \
        | tail -n1
)

[[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+\-[0-9]+$ ]] \
    && update-source-version necesse-server "$version"