updated on Sat Jan 14 00:11:12 UTC 2012
[aur-mirror.git] / torrentflux / torrentflux.install
blob2aa50aaec0432600db26b94f33551abc10f8490b
1 post_install() {
2   cat << EOF
3 OK. So youre about to install torrentflux? Postgresql and mysql are supported.
4 Instructions are for mysql so lets use it? ok? 
5 Remove mysql from depencies if you dont like.
6 (mysqlcommands might need '-u root -p' depending on your setup)
8 1. You need to create mysql database for it
9 mysqladmin create torrentflux 
10 (eg. 'mysqladmin -u root -p create torrentflux' if needed)
12 2. Load the script that creates tables and such 
13 (.sql files for postgresql are here too!)
14 mysql torrentflux < /opt/torrentflux/sql/mysql_torrentflux.sql
16 3. Edit the config.php located in /opt/torrentflux/html
18 4. Point your fav http server to use this,
19 (eg. use vhosts for apache or create symlink to /opt/torrentflux from 
20 somewhere that http server can access)
22 5. Our database user is "torrentfluxie"
23 (use mysql_setpermission to give rights for him)
24 mysql_setpermission -u mysqlroot
25 hit 5 in menu and choose torrentflux as database
26 give torrentfluxie as user and give password if you want 
27 (if you do this, you need to set the password to /opt/torrentflux/config.php:
28 $cfg["db_pass"] = "yourpass";)
29 localhost is good choice for host 
30 (we dont need password always if we got private comp)
32 6. Safemode must be off in php.ini (/etc/php.ini)
34 httpd server must support php and mysql, you can look for archwiki 
35 if you dont know howto enable them.
36 Notice that the httpd server should belong to daemon group 
37 (one way or another)
38 EOF
41 post_upgrade() {
42  cat << EOF
43 To upgrade your database, use files in /opt/torrentflux/
44 (eg for 2.2 -> 2.4 go from browser to http://yourtorrentfuxdomain.and.path/upgradeflux22_23.php 
45 and do the same on upgradeflux23_24.php file)
46 All your old information should stay trough the upgrades
47 When it tells you to remove the files, just chmod them to 000 and they will not harm.
48 EOF
51 pre_remove() {
52   /bin/echo "Remember to remove mysql tables if you want :p"
53   /bin/echo "mysqladmin -f drop torrentflux" 
54   /bin/echo "(remeber -u root -p, hope it worked)"
57 op=$1
58 shift
60 $op $*