init commit
This commit is contained in:
		
							
								
								
									
										40
									
								
								install.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								install.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,40 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					# Author	: Thomas Schmauder, bib e.V.
 | 
				
			||||||
 | 
					# Datum		: 2023-03-16
 | 
				
			||||||
 | 
					# Funktion	: Installiere alle benötigten Module, um das VPN über die Menübar in macOS zu steuern. 
 | 
				
			||||||
 | 
					# Grund		: Schlanke Alternative zum fetten FortiClient VPN Only
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Variables
 | 
				
			||||||
 | 
					PLUGINDIR="/Users/$USER/Library/Application\ Support/SwiftBar/plugins"
 | 
				
			||||||
 | 
					# Farben definieren
 | 
				
			||||||
 | 
					noColor="\033[0m"; 
 | 
				
			||||||
 | 
					Purple='\033[0;35m' 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Installation
 | 
				
			||||||
 | 
					echo -e "${Purple}Checke, ob HomeBrew verfügbar ist${noColor}"
 | 
				
			||||||
 | 
					if ! which brew > /dev/null  ; then
 | 
				
			||||||
 | 
						echo -e "${Purple}Homebrew nicht verfügbar. Installiere...${noColor}"
 | 
				
			||||||
 | 
						/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo -e "${Purple}Starte die Installation der benötigten Komponenten (SwiftBar & OpenConnect)${noColor}"
 | 
				
			||||||
 | 
					brew update && brew install openconnect swiftbar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Konfiguration
 | 
				
			||||||
 | 
					echo -e "${Purple}Lade das Skript und stelle die Konfiguration für SwiftBar ein.${noColor}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					mkdir -p $PLUGINDIR && cd $PLUGINDIR
 | 
				
			||||||
 | 
					defaults write /Users/$USER/Library/Preferences/com.ameba.SwiftBar.plist PluginDirectory $PLUGINDIR
 | 
				
			||||||
 | 
					wget https://git.bib.de/ITS/OpenConnect_macOS_Bar/raw/branch/main/bibVPN.sh
 | 
				
			||||||
 | 
					chmod +x bibVPN.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# SecuritySettings
 | 
				
			||||||
 | 
					echo -e "${Purple}Setze die Security Einstellungen, damit man nicht immer nach dem Passwort gefragt wird.\nBitte dazu einmalig das Passwort für deinen Mac eingeben.${noColor}"
 | 
				
			||||||
 | 
					echo "$USER ALL=(ALL) NOPASSWD: $(which openconnect)
 | 
				
			||||||
 | 
					$USER ALL=(ALL) NOPASSWD: /usr/bin/killall -2 openconnect" | sudo tee /private/etc/sudoers.d/openconnect
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Erstmaliger Start vom Skript und SwiftBar
 | 
				
			||||||
 | 
					echo -e "${Purple}Starte nun das Skript erstmalig, um einen neuen Benutzer anzulegen.${noColor}"
 | 
				
			||||||
 | 
					$PLUGINDIR/bibVPN.sh newuser
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					open /Applications/SwiftBar.app
 | 
				
			||||||
		Reference in New Issue
	
	Block a user