1
0

这一次终于创成了,h3c堡垒机页面可以打开终端了

This commit is contained in:
Sense T 2025-03-03 12:50:37 +08:00
parent 914e7b2e76
commit 2f2bc09f3b
3 changed files with 8 additions and 8 deletions

View File

@ -40,4 +40,4 @@ TITLE=$(echo $ARGS | jq -r .st)
echo "Will connect to $TITLE..." echo "Will connect to $TITLE..."
passh -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o HostKeyAlgorithms=+ssh-rsa -p $PORT_NUM $USERNAME@$HOSTNAME xdg-terminal-exec passh -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o HostKeyAlgorithms=+ssh-rsa -p $PORT_NUM $USERNAME@$HOSTNAME

View File

@ -1,13 +1,12 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Version=@VERSION
Name=Access Client Name=Access Client
GenericName=Access Client GenericName=Access Client
Comment=Resource monitor that shows usage and stats for processor, memory, disks, network and processes Comment=Resource monitor that shows usage and stats for processor, memory, disks, network and processes
Comment[zh_CN]=H3C Comment[zh_CN]=H3C
Terminal=true Terminal=false
Categories=System;ConsoleOnly; Categories=System;ConsoleOnly;
Keywords=system;h3c; Keywords=system;h3c;
NoDisplay=true NoDisplay=true
Exec=@EXEC %u Exec=@EXEC %u
MimeType=application/x-accessclient;x-scheme-handler/accessclient; MimeType=application/x-accessclient;x-scheme-handler/accessclient;

View File

@ -1,6 +1,5 @@
{ {
stdenv, stdenv,
lib,
jq, jq,
zlib-ng, zlib-ng,
@ -8,6 +7,7 @@
coreutils, coreutils,
openssh, openssh,
which, which,
xdg-terminal-exec,
... ...
}: }:
let let
@ -24,6 +24,7 @@ stdenv.mkDerivation rec {
passh passh
coreutils coreutils
openssh openssh
xdg-terminal-exec
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
@ -35,13 +36,13 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
sed "/^export PATH=/s|@PATH|${coreutils}/bin:${jq}/bin:${passh}/bin:${zlib-ng.bin}/bin:${openssh}/bin|" "${bin}" > $out/bin/${pname} sed "/^export PATH=/s|@PATH|${coreutils}/bin:${jq}/bin:${passh}/bin:${zlib-ng.bin}/bin:${openssh}/bin:${xdg-terminal-exec}/bin|" "${bin}" > $out/bin/${pname}
chmod +x $out/bin/${pname} chmod +x $out/bin/${pname}
mkdir -p $out/share/applications mkdir -p $out/share/applications
sed "/^Version=/s|@VERSION|${version}|" "${desktop}" | sed "/^Exec=/s|@EXEC|$out/bin/${pname}|" > "$out/share/applications/${pname}.desktop" cat "${desktop}" | sed "/^Exec=/s|@EXEC|$out/bin/${pname}|" > "$out/share/applications/${pname}.desktop"
echo "PATH: $PATH" echo "PATH: $PATH"
which jq && which minideflate && which passh && which ssh || exit 1 which jq && which minideflate && which passh && which ssh && which xdg-terminal-exec || exit 1
''; '';
} }