...
Code Block |
---|
#!/bin/sh # Create a file in /tmp that has only the heaer " ChronoSync Version Report". Leading space is included so that when we run sort it will appear at top. echo " ChronoSync Version Report" > /tmp/CSyncVersion # Get a listing of only directories in /Home on the server and for each line (each directory) run the following commands. ls -d /Home/* | sed 's/\/Home\///g' | while read line do # If the user has the Templates directory, we can infer the they have version 4. Print this information to the report. if [ -e /Home/$line/Library/Application\ Support/ChronoSync/Templates ]; then echo "4 $line" >> /tmp/CSyncVersion else # If the user didn't have version 4, check to see if they have the ChronoSync application support directory and if they do, report that they have version 3 installed. if [ -e /Home/$line/Library/Application\ Support/ChronoSync/ ]; then echo "3 $line" >> /tmp/CSyncVersion else # If they didn't have the ChronoSync application support directory either, report that ChronoSync isn't installed (indicated with an X). echo "X $line" >> /tmp/CSyncVersion fi fi done # Get the contents of the report, sort them alphabetically, and display the results. sort /tmp/CSyncVersion # Remove the temporary report file. rm /tmp/CSyncVersion |
...