script for restore missing file
Posted: Tue Apr 03, 2018 12:12 pm
Hi everybody.
I am not very skilled with shell scripts, so I prefer to ask: I want to copy the file /boot/config.old to /boot/config.txt IF /boot/config.txt is missing OR has a size=0
I can make it with a c program, but I would prefer make a shell script or use commands in the /etc/rc.local script.
Do you have a example of testing if file exists or size=0 in a script ?
I am not very skilled with shell scripts, so I prefer to ask: I want to copy the file /boot/config.old to /boot/config.txt IF /boot/config.txt is missing OR has a size=0
I can make it with a c program, but I would prefer make a shell script or use commands in the /etc/rc.local script.
Do you have a example of testing if file exists or size=0 in a script ?