I`am a beginner in coding so I would ask for help to using this code on raspberry buster in a c program:
ping -c 1 -t 1 192.168.1.1;if [ $? -eq 0 ]; then echo "192.168.1.1 is up";
else echo "ip is down";fi
the code should do 1. if ip is up insert inputs from ig. a keypad to a mysql database 2. if ip is down write the inputs line by line a file
thank you very much for some tips.