From f846b16cb358ff37861a461bce53dbc6cdbaab06 Mon Sep 17 00:00:00 2001
From: Saad Chaaban <saad.chaaban@hu-berlin.de>
Date: Sun, 11 Oct 2020 01:35:28 +0200
Subject: [PATCH] macOS Scripte aktualisiert - Fehler beim Upload korrigiert

---
 macos/02_join_domain.command                 |  9 +++
 macos/03_homebrew_install.command            | 13 ++++
 macos/04_defaultsettings.command             | 75 ++++++++++++++++++++
 macos/IP_Adress_default_internal.command     |  5 ++
 macos/IP_Adress_default_whiteadapter.command |  5 ++
 macos/com.administrator.homebrewupdate.plist | 27 +++++++
 macos/homebrewupdate.sh                      |  7 ++
 7 files changed, 141 insertions(+)
 create mode 100644 macos/02_join_domain.command
 create mode 100644 macos/03_homebrew_install.command
 create mode 100644 macos/04_defaultsettings.command
 create mode 100644 macos/IP_Adress_default_internal.command
 create mode 100644 macos/IP_Adress_default_whiteadapter.command
 create mode 100644 macos/com.administrator.homebrewupdate.plist
 create mode 100644 macos/homebrewupdate.sh

diff --git a/macos/02_join_domain.command b/macos/02_join_domain.command
new file mode 100644
index 0000000..eb2438e
--- /dev/null
+++ b/macos/02_join_domain.command
@@ -0,0 +1,9 @@
+#!/bin/bash
+echo "Bitte Computername eingeben"
+read PCNameLocal
+echo "Bitte Lokales Administratorkennwort eingeben"
+read pwdlocal
+# Dieser Befehl kann sicher noch einmal gekürzt werden :)
+dsconfigad -a $PCNameLocal -f -alldomains enable -lu administrator -lp $pwdlocal -u sowi_sc -domain sowi.hu-berlin.de -status -ou "CN=Computers,DC=sowi,DC=hu-berlin,DC=de" -mobile enable -mobileconfirm disable -useuncpath enable -groups "Domain Admins,Enterprise Admins" -localhome enable -protocol smb -shell "/bin/bash" -nouid
+# Sicherheitshalber wird nach dem Befehl die Variable pwdlocal mit "emptystring" überschrieben
+pwdlocal=('emptystring')
diff --git a/macos/03_homebrew_install.command b/macos/03_homebrew_install.command
new file mode 100644
index 0000000..15dfbe3
--- /dev/null
+++ b/macos/03_homebrew_install.command
@@ -0,0 +1,13 @@
+#!/bin/bash
+defaultsoftware="anydesk appcleaner homebrew/cask-versions/firefox-esr vlc thunderbird atom"
+/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" && export HOMEBREW_NO_ANALYTICS=1 && brew analytics off && brew cask install $defaultsoftware --force
+# Flickschusterlösung!
+# Mac OS macht via Script Probleme mit CP und den Verzeichnis
+# (es start CP nicht im Verzeichnis in dem man gerade dieses Script startet)
+# MUSS GETESTET WERDEN
+BASEDIR=$(dirname "$0")
+file1=$(echo "$BASEDIR"/homebrewupdate.sh)
+file2=$(echo "$BASEDIR"/com.administrator.homebrewupdate.plist)
+sudo cp $file1 /System/Volumes/Data/homebrewupdate.sh && sudo chmod a+x /System/Volumes/Data/homebrewupdate.sh
+sudo cp $file2 /Library/LaunchDaemons/com.administrator.homebrewupdate.plist && launchctl load /Library/LaunchDaemons/com.administrator.homebrewupdate.plist
+exit
diff --git a/macos/04_defaultsettings.command b/macos/04_defaultsettings.command
new file mode 100644
index 0000000..4ee3c9e
--- /dev/null
+++ b/macos/04_defaultsettings.command
@@ -0,0 +1,75 @@
+#!/bin/bash
+# Dieses Script dient dazu ein paar "Standardeinstellungen" zu vereinfachen.
+# Die jeweiligen Erklärungen der einzelnen Abschnitte steht über den jeweiligen Befehl!
+# Kopiert die die "Connect" Commands in Shared und verschiebt das Script connect_edv auf dem Desktop des Administrators
+# Flickschusterlösung!
+# Mac OS macht via Script Probleme mit CP und den Verzeichnis
+# (es start CP nicht im Verzeichnis in dem man gerade dieses Script startet)
+# MUSS GETESTET WERDEN
+BASEDIR=$(dirname "$0")
+file1=$(echo "$BASEDIR"/Netzwerklaufwerke/connect_*)
+folder=$(echo "$BASEDIR"/Firefox)
+cp $file1 /Users/Shared/
+mv /Users/Shared/connect_edv.command /Users/$USER/Desktop/
+# Kopiert das Firefox Profil auf die Festplatte und sorgt dafür das Einstellungen und Lesezeichen gesetzt sind.
+echo "Kopiere Firefox Ordner"
+cp -R $folder ~/Library/Application\ Support/
+###############################################################################
+ # Allow ALL to install Printer! #
+ ##############################################################################
+
+sudo /usr/bin/security authorizationdb write system.preferences.printing allow
+sudo /usr/bin/security authorizationdb write system.print.operator allow
+sudo /usr/sbin/dseditgroup -o edit -n /Local/Default -a everyone -t group lpadmin
+sudo /usr/sbin/dseditgroup -o edit -n /Local/Default -a everyone -t group _lpadmin 
+
+###############################################################################
+ # FINDER SETTINGS #
+ ##############################################################################
+
+# Sorgt dafür das das die "Pathbar" immer angezeigt wird (klappt erst nach neustart!)
+defaults write com.apple.finder ShowPathbar -bool YES
+# Statusbar einblenben
+defaults write com.apple.finder ShowStatusBar -bool true
+# Festplatte auf dem Desktop anzeigen lassen
+defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
+# Avoid creating .DS_Store files on network volumes
+defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
+# Use list view in all Finder windows by default
+ # Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
+defaults write com.apple.Finder FXPreferredViewStyle -string "Nlsv"
+# Empty Trash securely by default
+defaults write com.apple.finder EmptyTrashSecurely -bool true
+###############################################################################
+ # Dock & hot corners #
+ ###############################################################################
+
+# Enable highlight hover effect for the grid view of a stack (Dock)
+ defaults write com.apple.dock mouse-over-hilte-stack -bool true
+# Set the icon size of Dock items to 36 pixels
+ defaults write com.apple.dock tilesize -int 36
+# Enable spring loading for all Dock items
+ defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
+# Show indicator lights for open applications in the Dock
+ defaults write com.apple.dock show-process-indicators -bool true
+# Speed up Mission Control animations
+ defaults write com.apple.dock expose-animation-duration -float 0.1
+# Remove the auto-hiding Dock delay
+ defaults write com.apple.Dock autohide-delay -float 0
+ # Remove the animation when hiding/showing the Dock
+ defaults write com.apple.dock autohide-time-modifier -float 0
+# Automatically hide and show the Dock
+ defaults write com.apple.dock autohide -bool true
+# Make Dock icons of hidden applications translucent
+ defaults write com.apple.dock showhidden -bool true
+# Hot corners
+
+ # Top left screen corner �� Mission Control
+ defaults write com.apple.dock wvous-tl-corner -int 2
+ defaults write com.apple.dock wvous-tl-modifier -int 0
+ # Top right screen corner �� Desktop
+ defaults write com.apple.dock wvous-tr-corner -int 4
+ defaults write com.apple.dock wvous-tr-modifier -int 0
+killall Finder
+
+exit
diff --git a/macos/IP_Adress_default_internal.command b/macos/IP_Adress_default_internal.command
new file mode 100644
index 0000000..387cf65
--- /dev/null
+++ b/macos/IP_Adress_default_internal.command
@@ -0,0 +1,5 @@
+#!/bin/bash
+#Dieses Script ist auf den Weißen USB Netzwerkadapter ausgelegt
+networksetup -setmanual Ethernet 141.20.134.144 255.255.254.0 141.20.134.1
+networksetup -setdnsservers Ethernet 141.20.1.3 141.20.1.31
+exit
diff --git a/macos/IP_Adress_default_whiteadapter.command b/macos/IP_Adress_default_whiteadapter.command
new file mode 100644
index 0000000..1c2bf67
--- /dev/null
+++ b/macos/IP_Adress_default_whiteadapter.command
@@ -0,0 +1,5 @@
+#!/bin/bash
+#Dieses Script ist auf den Weißen USB Netzwerkadapter ausgelegt
+networksetup -setmanual USB 10/100/1000 LAN 141.20.134.144 255.255.254.0 141.20.134.1
+networksetup -setdnsservers USB 10/100/1000 LAN 141.20.1.3 141.20.1.31
+exit
diff --git a/macos/com.administrator.homebrewupdate.plist b/macos/com.administrator.homebrewupdate.plist
new file mode 100644
index 0000000..b617688
--- /dev/null
+++ b/macos/com.administrator.homebrewupdate.plist
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+	<dict>
+		<key>EnvironmentVariables</key>
+		<dict>
+			<key>PATH</key>
+			<string>/bin:/usr/bin:/usr/local/bin</string>
+		</dict>
+		<key>UserName</key>
+		<string>administrator</string>
+		<key>Label</key>
+		<string>com.administrator.homebrewupdate</string>
+		<key>LowPriorityIO</key>
+		<true/>
+		<key>Program</key>
+		<string>/System/Volumes/Data/homebrewupdate.sh</string>
+		<key>RunAtLoad</key>
+		<true/>
+		<key>StandardErrorPath</key>
+		<string>/tmp/administrator.homebrewupdate.err</string>
+		<key>StandardOutPath</key>
+		<string>/tmp/administrator.homebrewupdate.out</string>
+		<key>StartInterval</key>
+		<integer>18000</integer>
+	</dict>
+</plist>
diff --git a/macos/homebrewupdate.sh b/macos/homebrewupdate.sh
new file mode 100644
index 0000000..595a923
--- /dev/null
+++ b/macos/homebrewupdate.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+for task in 'update' 'upgrade' 'cleanup'
+do
+ echo "Executing brew $task"
+ /usr/local/bin/brew $task
+done
+# brew install wget
-- 
GitLab