mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
- @noahtalerman: I think we can merge in this PR before we dogfood the scripts ourselves. Dogfood request is here: https://github.com/fleetdm/fleet/issues/33170 --- - @noahtalerman: `customer-montague` was frustrated that they had to re-deploy fleetd to enable scripts. At organizations that have a third-party tool that can run scripts (other than Fleet), this is avoidable! We want to document how to enable scripts remotely w/o re-deploying fleetd. More context: https://github.com/fleetdm/fleet/issues/29193#issuecomment-3137337041
16 lines
560 B
Bash
16 lines
560 B
Bash
#!/bin/bash
|
|
# Please don't delete. This script is used in the guide here: https://fleetdm.com/guides/scripts
|
|
|
|
if [ "$EUID" -ne 0 ]; then
|
|
echo "This script requires administrator privileges. Please run with sudo."
|
|
exit 1
|
|
fi
|
|
# Enable scripts in Orbit environment variables
|
|
if grep -q "^ORBIT_ENABLE_SCRIPTS=" /etc/default/orbit; then
|
|
sed -i 's/^ORBIT_ENABLE_SCRIPTS=.*/ORBIT_ENABLE_SCRIPTS=true/' /etc/default/orbit
|
|
else
|
|
echo "ORBIT_ENABLE_SCRIPTS=true" >> /etc/default/orbit
|
|
fi
|
|
# Reload and restart Orbit
|
|
systemctl daemon-reload
|
|
systemctl restart orbit
|