1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-31 00:03:07 +03:00

Fix shellcheck issues

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2024-03-21 17:48:46 +01:00
parent 45334b6736
commit b6fd4912d7
6 changed files with 22 additions and 19 deletions

View File

@ -2,11 +2,11 @@
# Based on Github Action
# https://github.com/yshui/git-clang-format-lint
diff=`git-clang-format --diff --commit $CI_MERGE_REQUEST_DIFF_BASE_SHA`
diff=$(git-clang-format --diff --commit "$CI_MERGE_REQUEST_DIFF_BASE_SHA")
[ "$diff" = "no modified files to format" ] && exit 0
[ "$diff" = "clang-format did not modify any files" ] && exit 0
printf "You have introduced coding style breakages, suggested changes:\n\n"
echo "$diff" | colordiff
echo "${diff}" | colordiff
exit 1

View File

@ -21,12 +21,12 @@ echo -e "${blue}Checking commit range: $CI_COMMIT_RANGE"
echo
echo
for commit in `git rev-list $CI_COMMIT_RANGE`; do
git show -s --format=%B $commit | grep "^Signed-off-by: " 2>&1 >/dev/null
for commit in $(git rev-list "$CI_COMMIT_RANGE"); do
git show -s --format=%B "$commit" | grep "^Signed-off-by: " >/dev/null 2>&1
ret=$?
if [ $ret -eq 1 ]; then
echo -e "${red} >>> Missing Signed-off-by trailer in commit $commit"
failed=`expr $failed + 1`
failed=$(("$failed" + 1))
fi
done

View File

@ -1,13 +1,14 @@
#!/bin/bash
export CIPHER=aes128-cbc
export DEST=localhost
echo "Upload raw SSH statistics"
echo "local machine: `uname -a`"
echo "Cipher : $CIPHER ; Destination : $DEST (`ssh $DEST uname -a`)"
echo "Local ssh version: `ssh -V 2>&1`"
echo "local machine: $(uname -a)"
echo "Cipher : $CIPHER ; Destination : $DEST ($(ssh $DEST uname -a))"
echo "Local ssh version: $(ssh -V 2>&1)"
echo "Ping latency to $DEST":
ping -q -c 1 -n $DEST
echo "Destination $DEST SSHD version : `echo | nc $DEST 22 | head -n1`"
echo "ssh login latency :`(time -f user:%U ssh $DEST 'id > /dev/null') 2>&1`"
echo "Destination $DEST SSHD version : $(echo | nc $DEST 22 | head -n1)"
echo "ssh login latency :$( (command time -f user:%U ssh $DEST 'id > /dev/null') 2>&1)"
./generate.py | dd bs=4096 count=100000 | time ssh -c $CIPHER $DEST "dd bs=4096 of=/dev/null" 2>&1

View File

@ -1,13 +1,14 @@
#!/bin/bash
export CIPHER=aes128-cbc
export DEST=localhost
echo "Upload raw SSH statistics"
echo "local machine: `uname -a`"
echo "Cipher : $CIPHER ; Destination : $DEST (`ssh $DEST uname -a`)"
echo "Local ssh version: `samplessh -V 2>&1`"
echo "local machine: $(uname -a)"
echo "Cipher : $CIPHER ; Destination : $DEST ($(ssh $DEST uname -a))"
echo "Local ssh version: $(samplessh -V 2>&1)"
echo "Ping latency to $DEST":
ping -q -c 1 -n $DEST
echo "Destination $DEST SSHD version : `echo | nc $DEST 22 | head -n1`"
echo "ssh login latency :`(time -f user:%U samplessh $DEST 'id > /dev/null') 2>&1`"
echo "Destination $DEST SSHD version : $(echo | nc $DEST 22 | head -n1)"
echo "ssh login latency :$( (command time -f user:%U samplessh $DEST 'id > /dev/null') 2>&1)"
./generate.py | dd bs=4096 count=100000 | strace samplessh -c $CIPHER $DEST "dd bs=4096 of=/dev/null" 2>&1

View File

@ -94,8 +94,8 @@ fi
# when creating more keys, we need to restart the p11-kit
# so it can pick up the new keys
if [ -h "$TESTDIR/p11-kit-server.socket" ]; then
kill -9 $(cat $TESTDIR/p11-kit-server.pid)
rm $TESTDIR/p11-kit-server.socket
kill -9 "$(cat "$TESTDIR/p11-kit-server.pid")"
rm "$TESTDIR/p11-kit-server.socket"
fi
# p11-kit complains if there is no runtime directory
@ -113,7 +113,7 @@ if [ $ret -ne 0 ]; then
echo "$out"
exit 1
fi
eval $out
eval "$out"
# Symlink the p11-kit-server socket to "known place"
P11_KIT_SERVER_ADDRESS_PATH=${P11_KIT_SERVER_ADDRESS:10}

View File

@ -1 +1,2 @@
/bin/echo -n $1 2>&1
#!/bin/sh
printf '%s' "$1" 2>&1