Skip to content

Latest commit

 

History

History
22 lines (11 loc) · 941 Bytes

README.md

File metadata and controls

22 lines (11 loc) · 941 Bytes

Script Name: CompareTIME

Description:

This Bash script compares the local time and the time of a remote server. First, the local time is retrieved using the date +%T command. Then, the remote time is retrieved using the ssh and date -u +%T commands. The remote time is then adjusted by adding 3 hours and 30 minutes using the date -u -d"$remote_time 3 hours 30 minutes" +%T command. Finally, the adjusted times are compared using the if statement. If the times are equal, the phrase "OK" is printed; otherwise, the phrase "NotOK" is printed.

Usage:

To use this script, first make it executable with the chmod +x script.sh command. Then, you can run it with the ./script.sh command.

Example:

Suppose your local time is 10:30:00 and the remote server time is 07:00:00. After running this script, the phrase "NotOK" will be printed.

Parameters:

This script takes no parameters.

Output:

This script prints the phrase "OK" or "NotOK".