gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
Write bash script to check internet connection using ping command, if there is response…
- User
Write bash script to check internet connection using ping command, if there is response don't do nothing but if there is not write "No internet"
- Assistant
#!/bin/bash
ping -c 1 google.com > /dev/null 2>&1
if [ $? -eq 0 ]; then echo "Internet connection is available" else echo "No internet connection" fi