#!/usr/bin/env bash playbook_add() { pkg install nfs-utils touch /etc/exports playbook_sync svc enable nfs svc enable rpcbind svc start nfs svc start rpcbind } playbook_sync() { local buffer="$(tmpfile)" local hash="$(file_hash /etc/exports)" # TODO: Write the config file! [[ "$(file_hash "$buffer")" == "$hash" ]] && return mv -- "$buffer" "/etc/exports" [[ "$BASHTARD_ACTION" == "add" ]] && return exportfs -rv } playbook_del() { svc stop rpcbind svc stop nfs svc disable rpcbind svc disable nfs pkg uninstall nfs-utils }