This sounds like a homework assignment where the issue is not the time but rather write a script to check that a correct parameter was passed. With
rdate, I presume that a time correction is logged somewhere (/var/log/rdate or syslog). So after the command is run, have the script grep the log file and pull out the time server IP address. Then compare that IP address to a grep of the user's history file to compare IP addresses to see if they are the same.
Again, I'm not sure what the lesson here is, but I would be filling out my drop card.
Code:
grep time /var/log/syslog
This gives me:
Feb 14 15:42:27 Mint14-Extensa ntpdate[9186]: adjust time server
67.212.118.201 offset -0.050166 sec
Bookmarks