This commit is contained in:
Konano 2023-07-16 01:18:47 +08:00
parent 8d993dadd9
commit d85e6ca44d

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
scriptdir=$(dirname $(realpath $0))
check_google_access() { check_google_access() {
abroad=0 abroad=0
local response=$(curl -s -o /dev/null -w "%{http_code}" -m 5 "http://www.google.com") local response=$(curl -s -o /dev/null -w "%{http_code}" -m 5 "http://www.google.com")
@ -27,13 +29,11 @@ configure_ssh_keygen() {
if [[ -z "$response" ]] || [[ $response =~ ^[Yy]$ ]]; then if [[ -z "$response" ]] || [[ $response =~ ^[Yy]$ ]]; then
mkdir -p ~/.ssh mkdir -p ~/.ssh
read -p "sshkey 的名字: " keyname read -p "sshkey 的名字: " sshkeyname
ssh-keygen -t ed25519 -C $keyname ssh-keygen -t ed25519 -C $sshkeyname
fi fi
} }
check_google_access check_google_access
configure_ssh configure_ssh
configure_ssh_keygen configure_ssh_keygen
# scriptdir=$(dirname $(realpath $0))