-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimportSSL
More file actions
47 lines (43 loc) · 1.35 KB
/
importSSL
File metadata and controls
47 lines (43 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Created by WAH-IT PHL L2
# *** SSL Import Script ***
echo "*** SSL Import Script ***"
echo 'Enter your local password: "concentrix"'
cd ~/Downloads
cert=$(ls -lt | grep .cer | sed -n 1p | awk '{print$9}')
import=$(sudo security add-trusted-cert -d -r trustAsRoot -k ~/Library/Keychains/login.keychain $cert)
echo Importing SSL Certificate to Keychains...
$import
echo
echo Changing SSL Certificate to Always Trust...
echo
sleep 2
echo Setting ComputerName and HostName...
name=$(security find-certificate -a ~/Library/Keychains/login.keychain | grep -A 1 CONCENTRIX-GVW-P-CA | tail -n 1 | cut -d\" -f4)
sudo scutil --set ComputerName "$name"
sudo scutil --set HostName "$name"
echo
echo Checking FortiClient Version...
ver=$(mdls -name kMDItemVersion /Applications/FortiClient.app/ | awk '{print$3}' | cut -d\" -f2)
echo FortiClient = "$ver"
echo
echo
echo Note: If issue persist, please re-install FortiClient in Self-Service.
echo
echo C O M P L E T E D !
echo
open /Applications/FortiClient.app
echo
echo Closing Terminal in 5 secs...
for (( i=5; i>=1; i-- ));
do
if [[ i -eq 1 ]]; then
echo
echo closing NOW.. !
echo
sudo killall Terminal
else
echo $i..
sleep 1
fi
done