-
Notifications
You must be signed in to change notification settings - Fork 138
/
postinst.tmpl
executable file
·96 lines (69 loc) · 2.68 KB
/
postinst.tmpl
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/sh
# Copyright 2013-Present Couchbase, Inc.
#
# Use of this software is governed by the Business Source License included in
# the file licenses/BSL-Couchbase.txt. As of the Change Date specified in that
# file, in accordance with the Business Source License, use of this software
# will be governed by the Apache License, Version 2.0, included in the file
# licenses/APL2.txt.
# postinst script for @@PRODUCT@@
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
if ! grep `uname -m` @@PREFIX@@/manifest.txt > /dev/null
then
cat <<EOF
ERROR: The machine architecture does not match this build
of the software. For example, installing a 32-bit build
on a 64-bit machine, or vice-versa. Please uninstall and
install a build with a matching architecture.
EOF
exit 1
fi
chown -R @@PRODUCT_BASE@@:@@PRODUCT_BASE@@ @@PREFIX@@
chmod 755 @@PREFIX@@/service/@@PRODUCT_EXEC@@_service_install.sh
chmod 755 @@PREFIX@@/examples
# create user if it does not exist
if [ -z `id -u @@PRODUCT_EXEC@@ 2>/dev/null` ]; then
useradd @@PRODUCT_EXEC@@
fi
cd @@PREFIX@@/service
./@@PRODUCT_EXEC@@_service_install.sh
SERVICE_CMD=`./@@PRODUCT_EXEC@@_service_install.sh --servicecmd`
export UPGRADE_MARKER=/tmp/@@PRODUCT_BASE@@-`date +%Y%m%d`-upgrade-from
cat <<EOF
You have successfully installed @@PRODUCT_BASE_CAP@@ Sync Gateway.
You can find sample @@PRODUCT_EXEC@@ configuration files in the @@PREFIX@@/examples folder.
You can control the Couchbase Sync Gateway service by using the following command:
${SERVICE_CMD}
That's it! Sync Gateway is now running on port 4984. See https://docs.couchbase.com/sync-gateway/current/get-started-verify-install.html on how to get started.
EOF
cat <<EOF
By using this software you agree to the End User License Agreement.
See @@PREFIX@@/LICENSE.txt.
EOF
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0