49 lines
1.6 KiB
Bash
49 lines
1.6 KiB
Bash
#!/bin/bash
|
|
|
|
##########################################################################
|
|
# Shellscript : Konfiguration des Identity Agent
|
|
# Autor : Jobst Heinermann, macenterprise gmbh
|
|
##########################################################################
|
|
|
|
#Variables
|
|
user=$(stat -f '%u %Su' /dev/console | cut -d ' ' -f 2)
|
|
server=$"gf0vyfgw055p.corp.int"
|
|
log_dir=$"/Users/$user/Library/Application Support/Identity Agent"
|
|
pref=$"/Users/$user/Library/Preferences/com.checkpoint.IdentityAgent.plist"
|
|
|
|
# Prüfung alter Voreinstellungsdatei
|
|
if [[ -f "$pref" ]]
|
|
then
|
|
rm $pref
|
|
fi
|
|
|
|
# Prüfung alter Database.plist
|
|
if [[ -f "$log_dir/Database.plist" ]]
|
|
then
|
|
rm "$log_dir/Database.plist"
|
|
fi
|
|
|
|
# Prüfung Log Verzeichnis
|
|
if [[ ! -d "$log_dir" ]]
|
|
then
|
|
mkdir -p "$log_dir"
|
|
fi
|
|
|
|
# Einträge erstellen
|
|
/usr/libexec/PlistBuddy -c "Add :CN2Fingerprint:gf0vyfgw055p.corp.int string FOOT MERT GAL SHIN DOCK WACK TOO LIND LAWN SCAR RATE DIRT" "$log_dir/Database.plist"
|
|
/usr/libexec/PlistBuddy -c "Add :ClientLogEnabled string NO" "$log_dir/Database.plist"
|
|
/usr/libexec/PlistBuddy -c "Add :Host2Info:gf0vyfgw055p.corp.int:cn string gf0vyfgw055p.corp.int" "$log_dir/Database.plist"
|
|
|
|
# write com.checkpoint.IdentityAgent.plist
|
|
defaults write $pref "Log Directory" "$log_dir"
|
|
defaults write $pref "Log Mode" -int 1
|
|
defaults write $pref "NSWindow Frame PrefWindow" "16 672 444 374 0 0 1920 1057 "
|
|
defaults write $pref "Server Address" "$server"
|
|
defaults write $pref "Server Mode" -int 1
|
|
defaults write $pref "Server Port" -int 443
|
|
|
|
# Rechte korregieren
|
|
chown $user $pref
|
|
chown -R $user "$log_dir"
|
|
|