Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 901 Bytes

File metadata and controls

44 lines (32 loc) · 901 Bytes

Common scripts (used by other scripts)

common > useful functions

# $1: test to run
# By default, assert breaks execution if test fails
# if _assert_wait = 1, assert waits for user to press key before continuing
assert(){
    !!!! implement test assertion
    
    if [ "${_assert_wait}" == "1" ]; then
	echo "Press enter..."
	read
    fi
}    

# Print message to stderr and exit (status code 1)
# $1: message to print
die() {
    echo "$1" >&2
    exit 1
}

common > add ubuntu repo

#!/bin/bash
readonly repo="$1"

if ! which add-apt-repository; then
    echo "Installing add-apt-repository"
    apt-get install -y software-properties-common
fi

echo "Adding repo ${repo}"

# !!!! syntax of add-apt-repository changes depending upon version...
add-apt-repository "${repo}"