diff --git a/init_root.sh b/init_root.sh index 29693f3..c8fa2ca 100755 --- a/init_root.sh +++ b/init_root.sh @@ -1,5 +1,7 @@ #!/bin/bash +scriptdir=$(dirname $(realpath $0)) + check_google_access() { abroad=0 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 mkdir -p ~/.ssh - read -p "sshkey 的名字: " keyname - ssh-keygen -t ed25519 -C $keyname + read -p "sshkey 的名字: " sshkeyname + ssh-keygen -t ed25519 -C $sshkeyname fi } check_google_access configure_ssh configure_ssh_keygen - -# scriptdir=$(dirname $(realpath $0))