diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 18:02:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 18:02:34 +0000 |
commit | fadeddfbb2aa38a980dd959b5ec1ffba7afd43cb (patch) | |
tree | a7bde6111c84ea64619656a38fba50909fa0bf60 /osx/scripts | |
parent | Initial commit. (diff) | |
download | lldpd-fadeddfbb2aa38a980dd959b5ec1ffba7afd43cb.tar.xz lldpd-fadeddfbb2aa38a980dd959b5ec1ffba7afd43cb.zip |
Adding upstream version 1.0.18.upstream/1.0.18upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'osx/scripts')
-rwxr-xr-x | osx/scripts/postinstall.in | 29 | ||||
-rwxr-xr-x | osx/scripts/preinstall.in | 7 |
2 files changed, 36 insertions, 0 deletions
diff --git a/osx/scripts/postinstall.in b/osx/scripts/postinstall.in new file mode 100755 index 0000000..9a21e74 --- /dev/null +++ b/osx/scripts/postinstall.in @@ -0,0 +1,29 @@ +#!/bin/bash + +set -e + +user="@PRIVSEP_USER@" +group="@PRIVSEP_GROUP@" + +dscl=/usr/bin/dscl +$dscl . -read "/Users/${user}" &> /dev/null || { + # We need to find a free UID/GID + uid=200 + while $($dscl . -list /Users uid | grep -q "\b${uid}$") || \ + $($dscl . -list /Groups gid | grep -q "\b${uid}$"); do + uid=$((${uid} + 1)) + done + $dscl . -create /Groups/${group} + $dscl . -create /Groups/${group} PrimaryGroupID ${uid} + $dscl . -create /Groups/${group} Password "*" + $dscl . -create /Groups/${group} RealName "lldpd privilege separation group" + $dscl . -create /Users/${user} + $dscl . -create /Users/${user} UserShell /usr/bin/false + $dscl . -create /Users/${user} NFSHomeDirectory /var/empty + $dscl . -create /Users/${user} PrimaryGroupID ${uid} + $dscl . -create /Users/${user} UniqueID ${uid} + $dscl . -create /Users/${user} Password "*" + $dscl . -create /Users/${user} RealName "lldpd privilege separation user" +} + +/bin/launchctl load "/Library/LaunchDaemons/im.bernat.lldpd.plist" diff --git a/osx/scripts/preinstall.in b/osx/scripts/preinstall.in new file mode 100755 index 0000000..bb73125 --- /dev/null +++ b/osx/scripts/preinstall.in @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +if /bin/launchctl list "im.bernat.lldpd" &> /dev/null; then + /bin/launchctl unload "/Library/LaunchDaemons/im.bernat.lldpd.plist" +fi |