View | Details | Raw Unified | Return to bug 148320
Collapse All | Expand All

(-)/usr/ports/net-mgmt/ifgraph/Makefile (-6 / +3 lines)
Lines 26-42 Link Here
26
PKGINSTALL=	${WRKDIR}/pkg-install
26
PKGINSTALL=	${WRKDIR}/pkg-install
27
PKGDEINSTALL=	${WRKDIR}/pkg-deinstall
27
PKGDEINSTALL=	${WRKDIR}/pkg-deinstall
28
28
29
IFGRAPH_USER=	ifgraph
29
USERS=	ifgraph
30
IFGRAPH_GROUP=	ifgraph
30
GROUPS=	ifgraph
31
31
32
PLFILES=	find-if.pl ifgraph.pl makegraph.pl
32
PLFILES=	find-if.pl ifgraph.pl makegraph.pl
33
DOCFILES=	CHANGELOG INSTALACAO INSTALL TODO LICENSE.TXT MUDANCAS
33
DOCFILES=	CHANGELOG INSTALACAO INSTALL TODO LICENSE.TXT MUDANCAS
34
34
35
SUB_FILES=	crontab pkg-deinstall pkg-install pkg-message
35
SUB_FILES=	crontab pkg-deinstall pkg-install pkg-message
36
SUB_LIST=	USER=${IFGRAPH_USER} GROUP=${IFGRAPH_GROUP} PERL=${PERL}
36
SUB_LIST=	USER=${USERS} PERL=${PERL}
37
38
pre-install:
39
	@ ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
40
37
41
do-install:
38
do-install:
42
.for plfile in ${PLFILES}
39
.for plfile in ${PLFILES}
(-)/usr/ports/net-mgmt/ifgraph/files/pkg-deinstall.in (-19 lines)
Lines 16-38 Link Here
16
16
17
  ;;
17
  ;;
18
18
19
POST-DEINSTALL)
20
  echo '---> Starting post-deinstall script:'
21
22
  if [ -f %%PREFIX%%/etc/ifgraph.conf -o \
23
       -d %%PREFIX%%/ifgraph -o \
24
       -d %%PREFIX%%/var/ifgraph ]; then
25
    echo '---> You seem to have made some custom ifGraph configuration.'
26
    echo '---> - The "%%USER%%" user and "%%GROUP%%" group were therefore not deleted.'
27
    echo '---> - You may delete them with "pw groupdel %%GROUP%%; pw userdel %%USER%%".'
28
29
  else
30
    echo '---> Removing group "%%GROUP%%"'
31
    /usr/sbin/pw groupdel -n %%GROUP%%
32
    echo '---> Removing user "%%USER%%"'
33
    echo 'y' | /usr/sbin/pw userdel -n %%USER%%
34
  fi
35
36
  ;;
37
38
esac
19
esac
(-)/usr/ports/net-mgmt/ifgraph/files/pkg-install.in (-28 lines)
Lines 6-39 Link Here
6
PATH=/bin:/usr/bin:/usr/sbin
6
PATH=/bin:/usr/bin:/usr/sbin
7
7
8
case $2 in
8
case $2 in
9
10
PRE-INSTALL)
11
  echo "---> Starting pre-install script:"
12
13
  if [ -z "%%USER%%" -o \
14
       -z "%%GROUP%%" ]; then
15
    echo "ERROR: A required pragma was empty"
16
    exit 1
17
  fi
18
19
  if pw showgroup "%%GROUP%%" 2>/dev/null; then
20
    echo "---> Using existing group \"%%GROUP%%\""
21
  else
22
    echo "---> Adding group \"%%GROUP%%\""
23
    pw addgroup %%GROUP%% -h - || exit 1
24
  fi
25
26
  # Create user if required
27
  if pw showuser "%%USER%%" 2>/dev/null; then
28
    echo "---> Using existing user \"%%USER%%\""
29
  else
30
    echo "---> Adding user \"%%USER%%\""
31
    pw adduser %%USER%% -g %%GROUP%% -h - \
32
      -s "/sbin/nologin" -c "ifGraph User" || exit 1
33
  fi
34
35
  ;;
36
37
POST-INSTALL)
9
POST-INSTALL)
38
  echo "---> Starting post-install script:"
10
  echo "---> Starting post-install script:"

Return to bug 148320