Fixed lxc-bootstrap to make a shallow clone, updated uninstall script, added initial debian wheezy requirements file

This commit is contained in:
Duncan Sommerville 2015-01-13 12:28:36 -05:00
parent 674b8c69e4
commit e7490d6b2d
4 changed files with 85 additions and 10 deletions

View File

@ -25,7 +25,8 @@ showhelp () {
-d, --install-dependencies -d, --install-dependencies
Install binary dependencies Install binary dependencies
-w, --web-user=WEB_USER -w, --web-user=WEB_USER
Set the default apache web user Set the apache web user. Defaults to www-data. Only change
this setting if you've changed the default apache web user
-r, --web-root=WEB_ROOT -r, --web-root=WEB_ROOT
Set the web root for Airtime files Set the web root for Airtime files
This will copy the Airtime application files and make them This will copy the Airtime application files and make them

View File

@ -0,0 +1,46 @@
php-pear
php5-gd
odbc-postgresql
python
python-virtualenv
libsoundtouch-ocaml
libtaglib-ocaml
libao-ocaml
libmad-ocaml
ecasound
libesd0
libportaudio2
libsamplerate0
libvo-aacenc0
patch
php5-curl
mpg123
libcamomile-ocaml-data
libpulse0
vorbis-tools
lsb-release
lsof
mp3gain
vorbisgain
flac
vorbis-tools
pwgen
libfaad2
php-apc
libmp3lame-dev
lame
libzend-framework-php
coreutils
sourcefabric-keyring
silan
libopus0

View File

@ -43,11 +43,7 @@ lxc-attach -n ${name} -e -- apt-get -y --force-yes install git
echo "...Done" echo "...Done"
echo -e "\n * Cloning Airtime..." echo -e "\n * Cloning Airtime..."
lxc-attach -n ${name} -- git clone https://github.com/sourcefabric/Airtime.git /usr/share/Airtime lxc-attach -n ${name} -- git clone https://github.com/sourcefabric/Airtime.git /usr/share/Airtime --branch 2.5.x-installer-monitless --depth 1
echo "...Done"
echo -e "\n * Checking out installer branch..."
lxc-attach -n ${name} -- git -C /usr/share/Airtime checkout 2.5.x-installer-monitless
echo "...Done" echo "...Done"
echo -e "\n * Running installer..." echo -e "\n * Running installer..."

View File

@ -1,16 +1,40 @@
#!/bin/bash -e #!/bin/bash -e
#-e Causes bash script to exit if any of the installers # -e Causes bash script to exit if any of the steps
#return with a non-zero return value. # return with a non-zero return value.
if [[ $EUID -ne 0 ]]; then if [[ $EUID -ne 0 ]]; then
echo "Please run as root user." echo "Please run as root user."
exit 1 exit 1
fi fi
getStorDirFromDatabase() {
# here-doc to execute this block as postgres user
su postgres <<'EOF'
set +e
result=$(psql -d airtime -tAc "SELECT directory FROM cc_music_dirs WHERE type='stor'")
set -e
# don't indent this!
EOF
echo $result
}
dropAirtimeDatabase() {
# here-doc to execute this block as postgres user
su postgres <<'EOF'
set +e
psql -d postgres -tAc "DROP DATABASE IF EXISTS airtime; DROP USER IF EXISTS airtime;"
set -e
# don't indent this!
EOF
}
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
AIRTIMEROOT=${SCRIPT_DIR} AIRTIMEROOT=${SCRIPT_DIR}
STOR_DIR=$(getStorDirFromDatabase)
FILES=( FILES=(
"${STOR_DIR}"
"/etc/airtime" "/etc/airtime"
"/var/log/airtime" "/var/log/airtime"
"/usr/lib/airtime" "/usr/lib/airtime"
@ -27,13 +51,19 @@ for i in ${FILES[*]}; do
echo $i echo $i
done done
echo -e "\nThis will permanently remove Airtime and all related files from your computer. \ echo -e "\nThis will *permanently* remove Airtime and all related files from your computer. \
Any files in Airtime directories will be deleted. Are you sure you want to proceed? (Y/n): \c" Any files in Airtime directories and subdirectories will be deleted. Are you sure you want to proceed? (Y/n): \c"
read IN read IN
if [[ ! ( "$IN" = "y" || "$IN" = "Y" ) ]]; then if [[ ! ( "$IN" = "y" || "$IN" = "Y" ) ]]; then
exit 0 exit 0
fi fi
echo -e "\nAre you sure you want to remove your music storage directory ${STOR_DIR} and all of its subdirectories? (Y/n): \c"
read IN
if [[ "$IN" = "y" || "$IN" = "Y" ]]; then
rm -rf ${STOR_DIR}
fi
echo "Uninstalling Airtime..." echo "Uninstalling Airtime..."
rm -rf /etc/airtime rm -rf /etc/airtime
rm -rf /var/log/airtime/ rm -rf /var/log/airtime/
@ -47,5 +77,7 @@ rm -f /usr/bin/airtime*
rm -f /etc/apache2/sites-enabled/airtime* rm -f /etc/apache2/sites-enabled/airtime*
rm -f /etc/apache2/sites-available/airtime* rm -f /etc/apache2/sites-available/airtime*
dropAirtimeDatabase
pip uninstall -y airtime-playout airtime-media-monitor pip uninstall -y airtime-playout airtime-media-monitor
echo "...Done" echo "...Done"