#!/bin/sh
# A swift hack. Sudoedit will call whatever your default editor is,  passing
# in the name of the tmp file that it has copied to the system file to (and
# thus created a file that you have write permissions for). Once the 'editor'
# finishes, sudo copies the tmp file over the top of the system file and
# restores priviledges. Instead of opening an editor, we can simply clobber
# the contents of the file with "3" to reset the memory based disk cache. The
# only other magic needed is to override the default editor to point at this
# script just before calling the sudoedit command - and thus we can have a non-
# interactive way to drop memcache.
#
# @author John Thompson [jmt12]
# @author Zach Cutlip [http://shadow-file.blogspot.com/2009/01/how-to-sudoedit-non-interactively.html]
ECHO=/bin/echo
$ECHO 3 > "$1";
exit;