Files
Alte_Skripte/de.ing.Remove_WiFi.sh
2026-02-16 15:05:15 +01:00

29 lines
1.1 KiB
Bash

#!/bin/bash
##########################################################################
# Shellscript : Entfernt das GUEST, EMPLOYEE und LAPTOP WiFi
# Author : jobst heinermann, macenterprise gmbh 2019
##########################################################################
user=$(stat -f '%u %Su' /dev/console | cut -d ' ' -f 2)
osascript <<EOF
set theWifiChoices to {"EMPLOYEE", "GUEST", "LAPTOP"}
set theWifiDel to choose from list theWifiChoices with prompt "Wähle das WLAN, dass entfernt werden soll" default items {"GUEST"}
do shell script "networksetup -setnetworkserviceenabled Wi-Fi off"
if theWifiDel = {"EMPLOYEE"} then
do shell script "networksetup -removepreferredwirelessnetwork en0 'EMPLOYEE'"
else if theWifiDel = {"GUEST"} then
do shell script "networksetup -removepreferredwirelessnetwork en0 'GUEST'"
else if theWifiDel = {"LAPTOP"} then
do shell script "networksetup -removepreferredwirelessnetwork en0 'LAPTOP'"
end if
do shell script "networksetup -setnetworkserviceenabled Wi-Fi on"
display dialog "Das WLAN wurde als Netzwerkoption entfernt." buttons {"OK"} default button 1
EOF