Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (52 sloc) 1.93 KB
#!/bin/sh
#
# @license http://www.gnu.org/licenses/gpl.html GPL Version 3
# @author Volker Theile <volker.theile@openmediavault.org>
# @author OpenMediaVault Plugin Developers <plugins@omv-extras.org>
# @copyright Copyright (c) 2009-2013 Volker Theile
# @copyright Copyright (c) 2013-2017 OpenMediaVault Plugin Developers
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set -e
. /etc/default/openmediavault
. /usr/share/openmediavault/scripts/helper-functions
OMV_SFTP_MATCHGROUP=${OMV_SFTP_MATCHGROUP:-"sftp-access"}
case "$1" in
configure)
# Activate package triggers.
dpkg-trigger update-fixperms
dpkg-trigger update-locale
# Initialize and migrate configuration database.
echo "Updating configuration database ..."
omv-confdbadm create "conf.service.sftp"
if [ -n "$2" ]; then
omv-confdbadm migrate "conf.service.sftp" "${2}"
fi
if ! getent group ${OMV_SFTP_MATCHGROUP} >/dev/null 2>&1; then
groupadd ${OMV_SFTP_MATCHGROUP}
fi
if deb-systemd-helper is-enabled ssh.service; then
omv-mkconf sftp
deb-systemd-invoke restart omv-sftp.service >/dev/null || true
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument '$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0
You can’t perform that action at this time.