Last active
February 15, 2021 19:58
-
-
Save woodie/6aaa1b200fcab510df9569316359706b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Keep this associative array up-to-date based on perforce packages | |
declare -A releases=( ["12.04"]="precise" ["14.04"]="trusty" ["16.04"]="xenial") | |
# https://www.perforce.com/perforce/doc.current/manuals/p4sag/chapter.install.html#install.linux.packages | |
os_name=`grep ^NAME= /etc/os-release | cut -c6- | tr -d '"'` | |
if [[ $os_name != "Ubuntu" ]] ; then | |
echo 'Sorry, only for Ubuntu.' | |
exit 1 | |
fi | |
version_id=`grep ^VERSION_ID= /etc/os-release | cut -c12- | tr -d '"'` | |
if [[ ${releases[$version_id]} == "" ]] ; then | |
echo 'Sorry, unsupported Ubuntu release.' | |
exit 1 | |
fi | |
plist="deb http://package.perforce.com/apt/ubuntu/ ${releases[$version_id]} release" | |
sudo bash -c "echo '$plist' > /etc/apt/sources.list.d/perforce.list" | |
echo '#### Importing Perforce package signing key.' | |
wget -q http://package.perforce.com/perforce.pubkey -O- | sudo apt-key add - | |
sudo apt-get update | |
echo '#### Installing Perforce helix-cli service package.' | |
sudo apt-get install helix-cli | |
# helix-p4d helix-p4dctl helix-proxy helix-broker helix-cli |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment