#!/bin/sh -e
# Restart netfs around suspend/resume.
# suspend,resume: 30,70

[ -x /etc/init.d/netfs ] || exit 0

lock=/var/run/apm/netfs

case "$1,$2" in
	suspend,*)
		if [ -f /var/lock/subsys/netfs ]; then
			service netfs stop
			touch "$lock"
		else
			rm -f "$lock"
		fi
		;;
	resume,suspend)
		if [ -f "$lock" ]; then
			rm -f "$lock"
			service netfs start
		fi
		;;
esac

exit 0
