diff --git a/Changes b/Changes index c4e1e877d..ba01fe979 100644 --- a/Changes +++ b/Changes @@ -14,6 +14,9 @@ toolbox: injector: * fix #537: Make -x, --xml-ua & --json-ua options equivalent and update help text +packaging: +* Update MacOSX packaging to use "com.teclib.glpi-agent" as AppID and service identifier + 1.6.1 Fri, 17 Nov 2023 core: diff --git a/contrib/macosx/glpi-agent-packaging.sh b/contrib/macosx/glpi-agent-packaging.sh index 1e354ff63..9dbb41da9 100755 --- a/contrib/macosx/glpi-agent-packaging.sh +++ b/contrib/macosx/glpi-agent-packaging.sh @@ -424,7 +424,7 @@ cat >pkg/build-info.plist <<-BUILD_INFO distribution_style identifier - org.glpi-project.glpi-agent + com.teclib.glpi-agent install_location / name @@ -518,7 +518,7 @@ cat >pkg/Distribution.xml <<-CUSTOM GLPI-Agent $VERSION ($ARCH) - $PKG + $PKG @@ -526,12 +526,12 @@ cat >pkg/Distribution.xml <<-CUSTOM - + - - + + @@ -557,7 +557,7 @@ cat >pkg/payload/Applications/GLPI-Agent/Contents/Info.plist <<-INFO_PLIST CFBundleExecutable glpi-agent CFBundleIdentifier - org.glpi-project.glpi-agent + com.teclib.glpi-agent CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/contrib/macosx/scripts/postinstall b/contrib/macosx/scripts/postinstall index 08c51b2e3..0a7394518 100755 --- a/contrib/macosx/scripts/postinstall +++ b/contrib/macosx/scripts/postinstall @@ -40,7 +40,7 @@ if [ "$DEST" != "/" ]; then fi echo "Only Tiger or newer OS supported, using LaunchDaemons plists" -TMPPLIST="$(touch org.glpi-project.glpi-agent.plist && echo org.glpi-project.glpi-agent.plist || mktemp -t org.glpi-project.glpi-agent)" +TMPPLIST="$(touch com.teclib.glpi-agent.plist && echo com.teclib.glpi-agent.plist || mktemp -t com.teclib.glpi-agent)" TPATH="/Library/LaunchDaemons" cat >"$TMPPLIST" < @@ -48,7 +48,7 @@ cat >"$TMPPLIST" < Label - org.glpi-project.glpi-agent + com.teclib.glpi-agent ProgramArguments $INSTALL_PATH/bin/glpi-agent @@ -65,17 +65,17 @@ cat >"$TMPPLIST" < PLIST if [ -s "$TMPPLIST" ]; then - sudo rm -f $TPATH/org.glpi-project.glpi-agent.plist - sudo cp -f "$TMPPLIST" $TPATH/org.glpi-project.glpi-agent.plist - sudo chown root:wheel $TPATH/org.glpi-project.glpi-agent.plist - sudo chmod 644 $TPATH/org.glpi-project.glpi-agent.plist + sudo rm -f $TPATH/com.teclib.glpi-agent.plist + sudo cp -f "$TMPPLIST" $TPATH/com.teclib.glpi-agent.plist + sudo chown root:wheel $TPATH/com.teclib.glpi-agent.plist + sudo chmod 644 $TPATH/com.teclib.glpi-agent.plist rm -f "$TMPPLIST" echo 'Loading Service' - sudo launchctl load $TPATH/org.glpi-project.glpi-agent.plist + sudo launchctl load $TPATH/com.teclib.glpi-agent.plist echo 'Starting Service' - sudo launchctl start org.glpi-project.glpi-agent + sudo launchctl start com.teclib.glpi-agent else echo "Failed to create service" fi diff --git a/contrib/macosx/scripts/preinstall b/contrib/macosx/scripts/preinstall index f20ec8603..f15045c2c 100755 --- a/contrib/macosx/scripts/preinstall +++ b/contrib/macosx/scripts/preinstall @@ -6,6 +6,13 @@ DEST="$2" INSTALL_PATH="${DEST%/}/Applications/GLPI-Agent" # Stop service and unload plist file if present +# Case for glpi-agent > 1.6.1 +if [ -e /Library/LaunchDaemons/com.teclib.glpi-agent.plist ]; then + echo "Stopping service" + sudo launchctl stop com.teclib.glpi-agent + sudo launchctl unload /Library/LaunchDaemons/com.teclib.glpi-agent.plist +fi +# Case for glpi-agent <= 1.6.1 if [ -e /Library/LaunchDaemons/org.glpi-project.glpi-agent.plist ]; then echo "Stopping service" sudo launchctl stop org.glpi-project.glpi-agent diff --git a/contrib/macosx/scripts/uninstaller.sh b/contrib/macosx/scripts/uninstaller.sh index 71f60ee81..bb076f06b 100755 --- a/contrib/macosx/scripts/uninstaller.sh +++ b/contrib/macosx/scripts/uninstaller.sh @@ -5,8 +5,8 @@ INSTALLPATH="`pwd`" cd .. echo "Stopping and unloading service" -sudo launchctl stop org.glpi-project.glpi-agent -sudo launchctl unload /Library/LaunchDaemons/org.glpi-project.glpi-agent.plist +sudo launchctl stop com.teclib.glpi-agent +sudo launchctl unload /Library/LaunchDaemons/com.teclib.glpi-agent.plist # Still wait until process has been stopped read PID XXX <<<`ps -ec -o pid,command | grep glpi-agent` @@ -37,8 +37,8 @@ done <<-FILES $INSTALLPATH /var/log/glpi-agent.log /usr/local/bin/dmidecode - /Library/LaunchDaemons/org.glpi-project.glpi-agent.plist + /Library/LaunchDaemons/com.teclib.glpi-agent.plist FILES # Unregister package -sudo pkgutil --forget org.glpi-project.glpi-agent $INSTALLPATH +sudo pkgutil --forget com.teclib.glpi-agent $INSTALLPATH