#!/bin/bash

set -e

RED='\e[1;31m'

if [[ "$EUID" -ne "0" ]]; then
        echo -e $RED "Run this script as root or with the sudo command to continue."
        exit 1
fi

systemctl enable --now zfs-import-cache.service || true
systemctl enable --now zfs-import-scan.service || true
systemctl enable --now zfs-import.target || true
systemctl enable --now zfs-load-module.service || true
systemctl enable --now zfs-mount.service || true
systemctl enable --now zfs-scrub-monthly@.timer || true
systemctl enable --now zfs-scrub-weekly@.timer || true
systemctl enable --now zfs-scrub@.service || true
systemctl enable --now zfs-share.service || true
systemctl enable --now zfs-trim-monthly@.timer || true
systemctl enable --now zfs-trim-weekly@.timer || true
systemctl enable --now zfs-trim@.service || true
systemctl enable --now zfs-volume-wait.service || true
systemctl enable --now zfs-volumes.target || true
systemctl enable --now zfs.target || true
systemctl enable --now zfs-import.service || true
systemctl enable --now zfs-load-key.service || true
