#!/bin/bash # # @license http://www.gnu.org/licenses/gpl.html GPL Version 3 # @author OpenMediaVault Plugin Developers # @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 . set -e . /usr/share/openmediavault/scripts/helper-functions case "$1" in configure) if ! omv_config_exists "/config/system/omvextras"; then echo "Initialize configuration" default_repos=$(cat /etc/omvextras/default_repos.xml | sed -e 's/^[ \t]*//' | tr '\n' ' ') omv_config_add_node_data "/config/system" "omvextras" "${default_repos}" fi # edit configs omv_config_update "/config/system/omvextras/repos/repo[uuid='eafd7090-0e48-11e6-9ce2-000c290ea003']/repo2" \ "http://apt.syncthing.net/ syncthing release" # change plex repo based on architecture if [[ $(arch) == arm* ]]; then plex_repo="" else plex_repo="https://downloads.plex.tv/repo/deb/ ./public main" fi omv_config_update "/config/system/omvextras/repos/repo[uuid='eafd450c-0e48-11e6-8349-000c290ea003']/repo2" "${plex_repo}" # delete old configs omv_config_delete "/config/system/omvextras/repos/repo[uuid='eafd86e8-0e48-11e6-97de-000c290ea003']" omv_config_delete "/config/system/omvextras/repos/repo[uuid='eafd9e1c-0e48-11e6-ab72-000c290ea003']" omv_config_delete "/config/system/omvextras/repos/repo[uuid='eafd5b32-0e48-11e6-98d2-000c290ea003']" omv_config_delete "/config/system/omvextras/repos/repo[uuid='eafdb488-0e48-11e6-a13f-000c290ea003']" omv_config_delete "/config/system/omvextras/repos/repo[uuid='eafdcad6-0e48-11e6-9e11-000c290ea003']" omv_config_delete "/config/system/omvextras/repos/repo[uuid='eafdcad6-0e48-11e6-9e23-000c290ea003']" omv_config_delete "/config/system/omvextrasorg" # delete unneeded file if [ -f /etc/apt/sources.list.d/backports.list ]; then rm -f /etc/apt/sources.list.d/backports.list fi # install keys if [ -x /usr/bin/apt-key ]; then KEYRING_LOCATION="/usr/share/keyrings/" apt-key add ${KEYRING_LOCATION}omvextrasdevs.key apt-key add ${KEYRING_LOCATION}omvplugindevs.gpg apt-key add ${KEYRING_LOCATION}xamarin.gpg apt-key add ${KEYRING_LOCATION}deluge.key apt-key add ${KEYRING_LOCATION}hwraid.le-vert.net.gpg.key apt-key add ${KEYRING_LOCATION}docker.gpg apt-key add ${KEYRING_LOCATION}syncthing.key apt-key add ${KEYRING_LOCATION}PlexSign.key fi # disable grub submenus on systems that use grub if [ -f /usr/sbin/update-grub ]; then omv-mkconf omvextras disablesubmenu fi # rewrite omv-extras .list file omv-mkconf omvextras update dpkg-trigger update-fixperms dpkg-trigger update-locale ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac exit 0