mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-26 00:55:14 +00:00
60c15aaf66
PR: ports/184924 Submitted by: rene Approved by: maintainer timeout (horde@ , 1 month)
86 lines
1.6 KiB
Bash
86 lines
1.6 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# Copied from databases/phpmyadmin.
|
|
|
|
PATH=/usr/sbin:/usr/bin:/bin ; export PATH
|
|
|
|
hordedir=%%HORDIR%%
|
|
hordeusr=%%HORDEADMUSR%%
|
|
hordegrp=%%HORDEGRP%%
|
|
|
|
hordegcos="Horde Owner"
|
|
hordehome=/nonexistent
|
|
hordeshell=/sbin/nologin
|
|
|
|
create_group() {
|
|
local user group gcos home shell
|
|
|
|
user=$1
|
|
group=$2
|
|
gcos=$3
|
|
home=$4
|
|
shell=$5
|
|
|
|
if pw groupadd -n $group ; then
|
|
echo "===> Group $group created"
|
|
else
|
|
cat <<-EOERRORMSG
|
|
*** Failed to create the $group group.
|
|
|
|
Please add the $user user and $group group
|
|
manually with the commands:
|
|
|
|
pw groupadd -n $group
|
|
pw useradd -n $user -g $group -c "$gcos" \\
|
|
-d $home -s $shell -h -
|
|
|
|
and retry installing this package.
|
|
EOERRORMSG
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
|
|
create_user() {
|
|
local user group gcos home shell
|
|
|
|
user=$1
|
|
group=$2
|
|
gcos=$3
|
|
home=$4
|
|
shell=$5
|
|
|
|
if pw useradd -n $user -g $group -c "$gcos" -d $home -s $shell -h - ; then
|
|
echo "===> Created $user user"
|
|
else
|
|
cat <<-EOERRORMSG
|
|
*** Failed to create the $user user.
|
|
|
|
Please add the $user user manually with the command:
|
|
|
|
pw useradd -n $user -g $group -c "$gcos" \\
|
|
-d $home -s $shell -h -
|
|
|
|
and retry installing this package.
|
|
EOERRORMSG
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
|
|
case $2 in
|
|
POST-INSTALL)
|
|
if [ -z "${PACKAGE_BUILDING}" ]; then
|
|
# Copy over sample config files unless they already exist
|
|
|
|
for cf in %%HORDIR%%/config/*.dist; do
|
|
if [ ! -f ${cf%.dist} ]; then
|
|
cp -p $cf ${cf%.dist}
|
|
fi
|
|
done
|
|
fi
|
|
;;
|
|
esac
|