Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 175 lines (161 sloc) 6.735 kb
608ce1a1 » Jonathan Hoyt
2010-02-22 first commit
1 #!/bin/bash
2
05be2719 » Jonathan Hoyt
2010-02-22 second commit
3 # prereq
8f037c02 » Jonathan Hoyt
2010-03-05 updated to work with debian
4 # su root
5 # apt-get update && apt-get upgrade && apt-get install sudo git-core
6 # add "jukeman ALL=(ALL) ALL" to the /etc/sudoers
7 # git clone git://github.com/jonmagic/jukeman_installer.git && cd jukeman_installer && sh install
608ce1a1 » Jonathan Hoyt
2010-02-22 first commit
8
05be2719 » Jonathan Hoyt
2010-02-22 second commit
9 # install required packages
88497379 » Jonathan Hoyt
2010-03-05 updated tinc config
10 sudo apt-get install build-essential libssl-dev libreadline5-dev alsa-utils mpd mpc liblzo2-2 liblzo2-dev bridge-utils
8f037c02 » Jonathan Hoyt
2010-03-05 updated to work with debian
11
12 # set mixer volumes
c9d72749 » Jonathan Hoyt
2010-03-10 updated mongo and mongo gem versions
13 amixer sset Master 80 unmute
8f037c02 » Jonathan Hoyt
2010-03-05 updated to work with debian
14 amixer sset PCM 250 unmute
15 amixer sset Front 100 unmute
81df25c0 » Jonathan Hoyt
2010-02-22 added tinc config
16
88497379 » Jonathan Hoyt
2010-03-05 updated tinc config
17 # compile tinc
18 cd src
19 tar zxvf tinc-1.0.12.tar.gz
20 cd tinc-1.0.12
21 ./configure
22 make
23 sudo make install
5e84f51c » Jonathan Hoyt
2010-03-05 switched from god to bluepill, this is a working version
24 sudo mkdir -p /usr/local/var/run
25 sudo mkdir -p /usr/local/var/log
88497379 » Jonathan Hoyt
2010-03-05 updated tinc config
26 cd ..
61355f2c » Jonathan Hoyt
2010-03-05 fixed little mistake
27 cd ..
88497379 » Jonathan Hoyt
2010-03-05 updated tinc config
28
81df25c0 » Jonathan Hoyt
2010-02-22 added tinc config
29 # setup network to server
61355f2c » Jonathan Hoyt
2010-03-05 fixed little mistake
30 # read -p "What is the REAL ip of the tinc central server (e.g. 67.59.29.202)? " serverip
31 echo "Address = 67.59.29.202" > tinc/vpn/hosts/central
32 # read -p "What is your vpn network subnet (e.g. 10.111.222.0/24)? " subnet
33 echo "Subnet = 10.111.222.0/24" >> tinc/vpn/hosts/central
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
34 ### replace with key from central server
88497379 » Jonathan Hoyt
2010-03-05 updated tinc config
35 echo "-----BEGIN RSA PUBLIC KEY-----" >> tinc/vpn/hosts/central
36 echo "MIGJAoGBAOJA5efj4bw3Rr1HVLuAZZxJFaQcmEB4Ji9wQfgtfneNN1D9M/6lGfTh" >> tinc/vpn/hosts/central
37 echo "0fRRdS1FWFCG27dX+0j4Om7SG+1FKTaJMSdWzBp2pnIC3nGilrCWqCerdENzrMuW" >> tinc/vpn/hosts/central
38 echo "VtPsrNyPiK18g1+0tXthHgQbVHptBWktLR3X1gtGXijB0dh6lxSxAgMBAAE=" >> tinc/vpn/hosts/central
39 echo "-----END RSA PUBLIC KEY-----" >> tinc/vpn/hosts/central
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
40 read -p "What do you want your tinc name to be? It cannot have spaces or dashes, and will be used for vpn and jukeman location name: " myname
364a6cbf » Jonathan Hoyt
2010-03-05 more tinc fixes
41 echo "Name = $myname" > tinc/vpn/tinc.conf
88497379 » Jonathan Hoyt
2010-03-05 updated tinc config
42 echo "ConnectTo = central" >> tinc/vpn/tinc.conf
43 echo "Device = /dev/net/tun" >> tinc/vpn/tinc.conf
44 echo "Mode = switch" >> tinc/vpn/tinc.conf
364a6cbf » Jonathan Hoyt
2010-03-05 more tinc fixes
45 echo "PrivateKeyFile = /usr/local/etc/tinc/vpn/rsa_key.priv" >> tinc/vpn/tinc.conf
5e84f51c » Jonathan Hoyt
2010-03-05 switched from god to bluepill, this is a working version
46 echo "Subnet = 10.111.222.0/24" > tinc/vpn/hosts/$myname
2957cdb4 » Jonathan Hoyt
2010-02-26 updated jukeman and navvy start scripts and switched to use god for m…
47 read -p "What do you want your tinc ip to be (e.g. 10.111.222.???)? " myip
88497379 » Jonathan Hoyt
2010-03-05 updated tinc config
48 echo "ifconfig bridge $myip netmask 255.255.255.0" >> tinc/vpn/tinc-up
49 echo "ifconfig bridge up" >> tinc/vpn/tinc-up
50 sudo cp -r tinc /usr/local/etc/
81df25c0 » Jonathan Hoyt
2010-02-22 added tinc config
51 sudo tincd -n vpn -K
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
52 clear
53 echo "Copy the following file and paste it to /etc/tinc/vpn/hosts/$myname on the tinc server:"
54 echo ""
55 echo ""
5e84f51c » Jonathan Hoyt
2010-03-05 switched from god to bluepill, this is a working version
56 cat /usr/local/etc/tinc/vpn/hosts/$myname
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
57 sleep 30
58
59 # move to src dir
60 cd src
608ce1a1 » Jonathan Hoyt
2010-02-22 first commit
61
62 # download and install ruby
05be2719 » Jonathan Hoyt
2010-02-22 second commit
63 # wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p248.tar.gz
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
64 tar zxvf ruby-1.8.7-p248.tar.gz
608ce1a1 » Jonathan Hoyt
2010-02-22 first commit
65 cd ruby-1.8.7-p248
66 ./configure
67 make
1b90d621 » Jonathan Hoyt
2010-02-22 added sudo to ruby and rubygems installs, added conditional reboot
68 sudo make install
608ce1a1 » Jonathan Hoyt
2010-02-22 first commit
69 cd ..
70
71 # download and install rubygems
05be2719 » Jonathan Hoyt
2010-02-22 second commit
72 # wget http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz
73 tar zxvf rubygems-1.3.6.tgz
74 cd rubygems-1.3.6
1b90d621 » Jonathan Hoyt
2010-02-22 added sudo to ruby and rubygems installs, added conditional reboot
75 sudo ruby setup.rb
608ce1a1 » Jonathan Hoyt
2010-02-22 first commit
76 cd ..
77
05be2719 » Jonathan Hoyt
2010-02-22 second commit
78 # setup and install mongo
30a72dd2 » Jonathan Hoyt
2010-03-25 updated mongodb version
79 while true; do
80 read -p "Install mongodb 32bit or 64bit? (32, 64) " yn
81 case $yn in
939080b3 » Jonathan Hoyt
2010-03-25 updated to mongodb 1.4.0
82 32 ) wget http://downloads.mongodb.org/linux/mongodb-linux-i686-1.4.0.tgz; tar zxvf mongodb-linux-i686-1.4.0.tgz; sudo mv mongodb-linux-i686-1.4.0 /opt/mongodb; break;;
83 64 ) wget http://downloads.mongodb.org/linux/mongodb-linux-x86_64-1.4.0.tgz; tar zxvf mongodb-linux-x86_64-1.4.0.tgz; sudo mv mongodb-linux-x86_64-1.4.0 /opt/mongodb; break;;
30a72dd2 » Jonathan Hoyt
2010-03-25 updated mongodb version
84 * ) echo "Please answer 32 or 64.";;
85 esac
86 done
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
87 echo "logappend = true" >> mongod_settings.conf
88 echo "logpath = /var/log/mongodb/mongod.log " >> mongod_settings.conf
89 echo "dbpath = /data/db" >> mongod_settings.conf
90 echo "master = true" >> mongod_settings.conf
81df25c0 » Jonathan Hoyt
2010-02-22 added tinc config
91 while true; do
92 read -p "Is this a slave jukebox (y/n)? " yn
93 case $yn in
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
94 [Yy]* ) echo "slave = true" >> mongod_settings.conf; read -p "What is the address to the master (e.g. 10.10.10.5:27017)? " ip; echo "source = $ip" >> mongod_settings.conf; break;;
fff5fc0f » Jonathan Hoyt
2010-03-05 small update
95 [Nn]* ) break;;
30a72dd2 » Jonathan Hoyt
2010-03-25 updated mongodb version
96 * ) echo "Please answer y or n.";;
81df25c0 » Jonathan Hoyt
2010-02-22 added tinc config
97 esac
98 done
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
99 sudo mv mongod_settings.conf /opt/mongodb/
05be2719 » Jonathan Hoyt
2010-02-22 second commit
100 sudo mkdir -p /data/db
db5c37e6 » Jonathan Hoyt
2010-02-22 trying to get the mongod conf working
101 sudo mkdir -p /var/log/mongodb
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
102 sudo ln -s /opt/mongodb/bin/mongo /usr/bin/mongo
103 sudo ln -s /opt/mongodb/bin/mongod /usr/bin/mongod
104 sudo ln -s /opt/mongodb/bin/mongodump /usr/bin/mongodump
105 sudo ln -s /opt/mongodb/bin/mongorestore /usr/bin/mongorestore
05be2719 » Jonathan Hoyt
2010-02-22 second commit
106
608ce1a1 » Jonathan Hoyt
2010-02-22 first commit
107 # install required gems
db5c37e6 » Jonathan Hoyt
2010-02-22 trying to get the mongod conf working
108 sudo gem install rails -v2.3.5 --no-ri --no-rdoc
bcabbc5e » Jonathan Hoyt
2010-03-25 added mongrel gem for serving stuff
109 sudo gem install mongrel -v1.1.5 --no-ri --no-rdoc
c9d72749 » Jonathan Hoyt
2010-03-10 updated mongo and mongo gem versions
110 sudo gem install mongo -v0.19.1 --no-ri --no-rdoc
111 sudo gem install mongo_ext -v0.19.1 --no-ri --no-rdoc
5e84f51c » Jonathan Hoyt
2010-03-05 switched from god to bluepill, this is a working version
112 # sudo gem install mongrel -v1.1.5 --no-ri --no-rdoc
c9d72749 » Jonathan Hoyt
2010-03-10 updated mongo and mongo gem versions
113 sudo gem install mongo_mapper -v0.7.1 --no-ri --no-rdoc
db5c37e6 » Jonathan Hoyt
2010-02-22 trying to get the mongod conf working
114 sudo gem install mime-types -v1.16 --no-ri --no-rdoc
115 sudo gem install ruby-mp3info -v0.6.13 --no-ri --no-rdoc
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
116 sudo gem install navvy -v0.1.0 --no-ri --no-rdoc
8a98e0e0 » Jonathan Hoyt
2010-02-28 fixed god scripts
117 sudo gem install crack -v0.1.6 --no-ri --no-rdoc
118 sudo gem install httparty -v0.5.2 --no-ri --no-rdoc
c9d72749 » Jonathan Hoyt
2010-03-10 updated mongo and mongo gem versions
119 sudo gem install wand -v0.2.1 --no-ri --no-rdoc
120 sudo gem install jnunemaker-grip -v0.1.1 --no-ri --no-rdoc
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
121 # wget http://github.com/jonmagic/rack-gridfs/raw/master/pkg/rack-gridfs-0.2.0.gem
e0288da5 » Jonathan Hoyt
2010-03-24 fixed rack-gridfs gem to work with slave connections and included it
122 # sudo gem install jnunemaker-rack-gridfs-0.3.0.gem --no-ri --no-rdoc
123 sudo gem install jnunemaker-rack-gridfs-0.3.0.gem
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
124 # wget http://github.com/jonmagic/librmpd/raw/master/pkg/librmpd-0.1.1.gem
e678c6aa » Jonathan Hoyt
2010-03-04 fixing minor bugs
125 sudo gem install librmpd-0.1.1.gem --no-ri --no-rdoc
5e84f51c » Jonathan Hoyt
2010-03-05 switched from god to bluepill, this is a working version
126 # sudo gem install god -v0.8.0 --no-ri --no-rdoc
127 sudo gem install bluepill -v0.0.36 --no-ri --no-rdoc
8f037c02 » Jonathan Hoyt
2010-03-05 updated to work with debian
128 cd ..
e678c6aa » Jonathan Hoyt
2010-03-04 fixing minor bugs
129
8f037c02 » Jonathan Hoyt
2010-03-05 updated to work with debian
130 # copy init scripts
88497379 » Jonathan Hoyt
2010-03-05 updated tinc config
131 sudo cp init_scripts/tinc /etc/init.d/
132 sudo update-rc.d tinc defaults
8f037c02 » Jonathan Hoyt
2010-03-05 updated to work with debian
133 sudo cp init_scripts/mongod /etc/init.d/
134 sudo update-rc.d mongod defaults
5e84f51c » Jonathan Hoyt
2010-03-05 switched from god to bluepill, this is a working version
135 sudo cp init_scripts/bluepill /etc/init.d/
136 sudo update-rc.d bluepill defaults 91
8f037c02 » Jonathan Hoyt
2010-03-05 updated to work with debian
137
138 # copy conf files
139 sudo cp conf/mpd.conf /etc/
608ce1a1 » Jonathan Hoyt
2010-02-22 first commit
140
141 # install jukeman
142 cd ~
143 mkdir apps
144 cd apps
145 git clone git://github.com/jonmagic/jukeman.git
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
146 cd jukeman
e678c6aa » Jonathan Hoyt
2010-03-04 fixing minor bugs
147 mkdir log
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
148 echo "development: &non_production_settings" >> config/settings.yml
149 echo " site_name: JukeMan" >> config/settings.yml
150 echo " mpd_port: 6600" >> config/settings.yml
151 echo " location: $myname" >> config/settings.yml
f86e8118 » Jonathan Hoyt
2010-03-26 made volume setting part of settings.yml
152 echo " volume: 80" >> config/settings.yml
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
153 echo " import_folder_path: /home/jukeman/music" >> config/settings.yml
154 echo "" >> config/settings.yml
155 echo "test:" >> config/settings.yml
156 echo " <<: *non_production_settings" >> config/settings.yml
157 echo " mpd_port: 7700" >> config/settings.yml
158 echo " location: Testing" >> config/settings.yml
159 echo "production:" >> config/settings.yml
160 echo " site_name: JukeMan" >> config/settings.yml
161 echo " mpd_port: 6600" >> config/settings.yml
162 echo " location: $myname" >> config/settings.yml
f86e8118 » Jonathan Hoyt
2010-03-26 made volume setting part of settings.yml
163 echo " volume: 80" >> config/settings.yml
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
164 echo " import_folder_path: /home/jukeman/music" >> config/settings.yml
165 clear
608ce1a1 » Jonathan Hoyt
2010-02-22 first commit
166
167 # reboot
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
168 while true; do
169 read -p "Reboot (y/n)? " yn
170 case $yn in
171 [Yy]* ) sudo reboot; break;;
fff5fc0f » Jonathan Hoyt
2010-03-05 small update
172 [Nn]* ) break;;
30a72dd2 » Jonathan Hoyt
2010-03-25 updated mongodb version
173 * ) echo "Please answer y or n.";;
90a0a88c » Jonathan Hoyt
2010-02-26 updated installer with latest scripts, gems, and changes
174 esac
175 done
Something went wrong with that request. Please try again.