. $LKP_SRC/lib/http.sh +. $LKP_SRC/lib/env.sh
Best practice is to use realpath.
may be in the same repo, it's better use relative path. you donot need to care the realpath where ever it is.
SCRIPT_DIR=$(dirname $(realpath $0)) PROJECT_DIR=$(dirname $SCRIPT_DIR)
If you want to get the top dir for the repo, use: git rev-parse --show-toplevel
Thanks, Luan Shengde
$PROJECT_DIR/lib/http.sh $PROJECT_DIR/lib/env.sh
Thanks, Chenglong
sshr_ip=$LKP_SERVER [ -n "$sshr_port" ] || sshr_port=5050 [ -n "$sshr_port_len" ] || sshr_port_len=2000 [ -n "$sshr_port_base" ] || sshr_port_base=50000
+generate_key_file() +{
- echo -e "y\n" | ssh-keygen -t rsa -b 2048 -N '' -f /etc/ssh/ssh_host_rsa_key
+}
run_ssh() { [ -n "$my_ssh_pubkey" ] || return umask 0077 mkdir -p /root/.ssh echo "$my_ssh_pubkey" > /root/.ssh/authorized_keys
- systemctl start sshd
- if is_docker; then
generate_key_file
sshd_path=$(cmd_path sshd)
$sshd_path -q
- else
systemctl start sshd
- fi
}
data_success()
2.23.0