File: magic.add

package info (click to toggle)
mscompress 0.4-10
  • links: PTS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 200 kB
  • sloc: ansic: 554; sh: 36; makefile: 20
file content (25 lines) | stat: -rw-r--r-- 463 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# This simple script adds entry to /usr/lib/magic
echo -n "Looking for magic file ... "

if [ x$1 != x ] ; then
	BUILDROOT=$1
fi

if [ -e "$BUILDROOT/usr/lib/magic" ] ; then
 MFILE="$BUILDROOT/usr/lib/magic"
elif [ -e "$BUILDROOT/etc/magic" ] ; then
 MFILE="$BUILDROOT/etc/magic"
else
 echo " not found."
 exit 0
fi

echo "$MFILE"

if [ -z "`grep END_OF_MSCOMPRESS $MFILE`" ] ; then
  cat magic.mscompress >>$MFILE
else
  echo Entry already present
fi