void-packages/srcpkgs/base-directories/INSTALL

28 lines
638 B
Text

case "${ACTION}" in
post)
# Create compat symlinks for /run.
mntpnts="tmp /run/tmp"
mntpnts="$mntpnts var/tmp /run/tmp"
mntpnts="$mntpnts var/run /run"
mntpnts="$mntpnts var/lock /run/lock"
mntpnts="$mntpnts lib/rc/init.d /run/init.d"
set -- ${mntpnts}
while [ $# -gt 0 ]; do
dir="$1"
dest="$2"
if [ -h "$dir" ]; then
if [ "$(readlink -f $dir)" != "$dest" ]; then
echo "WARNING: removing wrong symlink in /$dir..."
rm -f "$dir"
ln -sf "$dest" "$dir"
fi
elif [ -d "$dir" ]; then
echo "WARNING: removing directory /$dir..."
rm -rf "$dir"
ln -sf "$dest" "$dir"
fi
shift; shift;
done
;;
esac