#!/bin/sh

if grep belong /etc/magic 2>/dev/null >/dev/null; then
  LONG=belong
  SHORT=beshort
else
  LONG=long
  SHORT=short
fi

if grep dact /etc/magic 2>/dev/null >/dev/null; then
  echo Done
else
  echo "#------------------------------------------------------------------------------
# dact:  file(1) magic for DACT compressed files
#
3	string		DACT		DACT compressed data
>0	byte		>-1		(version %i.
>1	byte		>-1		\b%i.
>2	byte		>-1		\b%i)
>7	$LONG		>0		\b, original size: %i bytes
>11	$SHORT		>30		\b, block size: %i bytes" >> /etc/magic
  echo Done
fi
