Skip to content

Instantly share code, notes, and snippets.

@tspspi
Created November 11, 2018 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tspspi/005f283aeef883e695922e97e4e887c2 to your computer and use it in GitHub Desktop.
Save tspspi/005f283aeef883e695922e97e4e887c2 to your computer and use it in GitHub Desktop.
unfs3 rc.d startup script for FreeBSD
#!/bin/sh
# Startup script for unfs3 (http://unfs3.sourceforge.net) - inofficial script
#
# Use in rc.conf:
# unfs3d_enable="YES"
#
# One can override the location of the exports file via
# unfs3d_exports="/etc/exports"
#
# The default exports file is /etc/exports.unfsd
. /etc/rc.subr
name="unfs3d"
unfs3d_export=${unfs3d_export:-"/etc/exports.unfsd"}
start_cmd="${name}_start"
stop_cmd="${name}_stop"
unfs3d_start()
{
echo "Starting unfs3d from ${unfs3d_export}"
unfsd -e ${unfs3d_export}
}
unfs3d_stop()
{
echo "Stopping unfsd"
killall unfsd
}
load_rc_config $name
run_rc_command "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment