Skip to content

Commit

Permalink
postinstall (permissions, hostname, passwords)
Browse files Browse the repository at this point in the history
postinstall (permissions, hostname, passwords) for bat, bconsole and tray-monitor

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
joergsteffens authored and Marco van Wieringen committed Feb 17, 2015
1 parent 705511c commit 88a0e60
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
47 changes: 47 additions & 0 deletions debian/bareos-bat.postinst
@@ -0,0 +1,47 @@
#!/bin/sh
# postinst script for bareos
#
# 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

daemon_user=bareos
daemon_group=bareos

permissions()
{
chown root:${daemon_group} /etc/bareos/bat.conf
}

case "$1" in
configure)
permissions
/usr/lib/bareos/scripts/bareos-config initialize_local_hostname
/usr/lib/bareos/scripts/bareos-config initialize_passwords
;;
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
1 change: 1 addition & 0 deletions debian/bareos-bconsole.postinst
Expand Up @@ -29,6 +29,7 @@ case "$1" in
configure)
permissions
/usr/lib/bareos/scripts/bareos-config initialize_local_hostname
/usr/lib/bareos/scripts/bareos-config initialize_passwords
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
Expand Down
47 changes: 47 additions & 0 deletions debian/bareos-traymonitor.postinst
@@ -0,0 +1,47 @@
#!/bin/sh
# postinst script for bareos
#
# 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

daemon_user=bareos
daemon_group=bareos

permissions()
{
chown root:${daemon_group} /etc/bareos/tray-monitor.conf
}

case "$1" in
configure)
permissions
/usr/lib/bareos/scripts/bareos-config initialize_local_hostname
/usr/lib/bareos/scripts/bareos-config initialize_passwords
;;
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
1 change: 1 addition & 0 deletions platforms/rpms/bareos.spec
Expand Up @@ -885,6 +885,7 @@ echo "This is a meta package to install a full bareos system" > %{buildroot}%{_d
%if 0%{?build_bat}
%post bat
%{script_dir}/bareos-config initialize_local_hostname
%{script_dir}/bareos-config initialize_passwords
%endif

%pre director
Expand Down

0 comments on commit 88a0e60

Please sign in to comment.