Determine system age in a shell script
One way is to grab the number of seconds from /proc/uptime, then discard everything after the decimal (since Bash can compare integers but not floating point numbers).
So instead of this:
We get this:
sed 's/\..*//' /proc/uptime
In this example, my age threshold is 1 day (86400 seconds):
if [ $(sed 's/\..*//' /proc/uptime) -gt 86400 ]; then echo "I'm old" status=old else echo "I'm new" status=new fi