1
0

创死了……

This commit is contained in:
Sense T 2025-03-01 19:55:55 +08:00
parent ecef79447f
commit 914e7b2e76
2 changed files with 21 additions and 1 deletions
qzsec/access-client

@ -1,5 +1,7 @@
#!/usr/bin/env bash
export PATH=$PATH:@PATH
URL="$1"
if [ "$URL" == "" ]; then
@ -34,4 +36,8 @@ PORT_NUM=$(echo $ARGS | jq -r .pn)
USERNAME=$(echo $ARGS | jq -r .un)
PASSWORD=$(echo $ARGS | jq -r .pw)
TITLE=$(echo $ARGS | jq -r .st)
echo "Will connect to $TITLE..."
passh -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o HostKeyAlgorithms=+ssh-rsa -p $PORT_NUM $USERNAME@$HOSTNAME

@ -1,9 +1,13 @@
{
stdenv,
lib,
jq,
zlib-ng,
passh,
coreutils,
openssh,
which,
...
}:
let
@ -18,16 +22,26 @@ stdenv.mkDerivation rec {
jq
zlib-ng
passh
coreutils
openssh
];
nativeBuildInputs = [
coreutils
which
];
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
cp -rv "${bin}" $out/bin/${pname}
sed "/^export PATH=/s|@PATH|${coreutils}/bin:${jq}/bin:${passh}/bin:${zlib-ng.bin}/bin:${openssh}/bin|" "${bin}" > $out/bin/${pname}
chmod +x $out/bin/${pname}
mkdir -p $out/share/applications
sed "/^Version=/s|@VERSION|${version}|" "${desktop}" | sed "/^Exec=/s|@EXEC|$out/bin/${pname}|" > "$out/share/applications/${pname}.desktop"
echo "PATH: $PATH"
which jq && which minideflate && which passh && which ssh || exit 1
'';
}