fix sonarr and create audit
This commit is contained in:
@@ -94,11 +94,22 @@ remove_flatpaks() {
|
||||
}
|
||||
|
||||
# Function to enable systemd services if not already enabled
|
||||
# With --now, also start the services enabled here, after making systemd read
|
||||
# the unit files that packages just installed
|
||||
enable_services() {
|
||||
local now=()
|
||||
if [ "$1" = "--now" ]; then
|
||||
now=(--now)
|
||||
shift
|
||||
sudo systemctl daemon-reload
|
||||
fi
|
||||
for service in "$@"; do
|
||||
if ! systemctl is-enabled "$service" &> /dev/null; then
|
||||
# audit records the services you turn off; leave those off
|
||||
if grep -qsx "system $service" "$HOME/.config/coredesktop/services-off"; then
|
||||
echo "$service is turned off (see audit)."
|
||||
elif ! systemctl is-enabled "$service" &> /dev/null; then
|
||||
echo "Enabling $service..."
|
||||
sudo systemctl enable "$service"
|
||||
sudo systemctl enable "${now[@]}" "$service"
|
||||
else
|
||||
echo "$service is already enabled."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user