#!/bin/sh
# Arctic Linux - discard unused blocks on solid state disks.
# Enabled as a service so it runs once per boot; crond handles the weekly run.
NAME=fstrim
case "${1:-}" in
start) fstrim -a 2>/dev/null || fstrim / 2>/dev/null; exit 0 ;;
stop|restart) exit 0 ;;
# A oneshot has no process to report, so it is never "running". Saying otherwise
# makes 'service list' lie about it.
status) exit 3 ;;
*) echo "usage: $0 start|stop|restart|status" >&2; exit 2 ;;
esac
