#!/bin/sh # # Jitsi, the OpenSource Java VoIP and Instant Messaging client. # # Distributable under LGPL license. # See terms of license at gnu.org. # # sources.list setting for Jitsi updates. REPOCONFIG="deb http://download.jitsi.org/deb unstable/" SOURCES_PREAMBLE="### THIS FILE IS AUTOMATICALLY CONFIGURED ### # You may comment out this entry, but any other modifications may be lost.\n" APT_CONFIG="`which apt-config 2> /dev/null`" # Install the repository signing key install_key() { APT_KEY="`which apt-key 2> /dev/null`" if [ -x "$APT_KEY" ]; then "$APT_KEY" add - >/dev/null 2>&1 </dev/null) # Don't do anything if the file is there, since that probably means # we have already installed it if [ -r "$SOURCELIST" ]; then if [ ! "$REPOMATCH" ]; then # At this point wrong configuration is active. In that case, # just abandon the mess and recreate the file # with the correct configuration. printf "$SOURCES_PREAMBLE" > "$SOURCELIST" printf "$REPOCONFIG\n" >> "$SOURCELIST" if [ $? -eq 0 ]; then return 0 fi return 2 fi fi if [ -d "$APT_SOURCESDIR" ]; then printf "$SOURCES_PREAMBLE" > "$SOURCELIST" printf "$REPOCONFIG\n" >> "$SOURCELIST" if [ $? -eq 0 ]; then return 0 fi fi return 2 } ## MAIN ## install_key create_sources_lists