wrote a quick install script, and made a global config file for where to find files...
authorpaulr <me@pjr.cc>
Mon, 12 Jul 2010 01:18:42 +0000 (11:18 +1000)
committerpaulr <me@pjr.cc>
Mon, 12 Jul 2010 01:18:42 +0000 (11:18 +1000)
bin/pbdc
bin/pbdc-bacula
bin/pbdc-bacula.php
bin/pbdc.php
install.sh [new file with mode: 0644]

index 1868fda..9e42b07 100644 (file)
--- a/bin/pbdc
+++ b/bin/pbdc
@@ -2,4 +2,4 @@
 
 . /etc/pbdc.conf
 
-php $BASE_DIR/pbdc.php $*
\ No newline at end of file
+php $BASE_DIR/bin/pbdc.php $*
\ No newline at end of file
index c85e579..f26a430 100644 (file)
@@ -2,4 +2,4 @@
 
 . /etc/pbdc.conf
 
-php $BASE_DIR/pbdc-bacula.php $*
\ No newline at end of file
+php $BASE_DIR/bin/pbdc-bacula.php $*
\ No newline at end of file
index ac2ebcc..5225d49 100644 (file)
@@ -1,7 +1,8 @@
 <?php
-$BASE_LIB="../lib";
-$BASE_DATA="../db";
-$BACULA_USER="paulr";
+
+$BASE_LIB=$_SERVER["BASE_LIB"];
+$BASE_DATA=$_SERVER["BASE_DATA"];
+$BACULA_USER=$_SERVER["BACULA_USER"];
 
 global $BASE_DATA, $BASE_LIB, $BACULA_USER, $argv;
 
index b8de758..896ae8d 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 
-$BASE_LIB="../lib";
-$BASE_DATA="../db";
-$BACULA_USER="paulr";
+$BASE_LIB=$_SERVER["BASE_LIB"];
+$BASE_DATA=$_SERVER["BASE_DATA"];
+$BACULA_USER=$_SERVER["BACULA_USER"];
 
 global $BASE_DATA, $BASE_LIB, $BACULA_USER;
 
diff --git a/install.sh b/install.sh
new file mode 100644 (file)
index 0000000..be54318
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+read -p "Base directory for installation [/opt/pbdc/]:" install_base
+read -p "Bacula User ID [bacula]:" user_id
+
+if [ "x$install_base" == "x" ]
+then
+       install_base="/opt/pdbc"
+fi
+
+if [ "x$user_id" == "x" ]
+then
+       user_id="bacula"
+fi
+
+mkdir -p $install_base/bin
+mkdir -p $install_base/lib
+mkdir -p $install_base/db
+
+export install_base user_id
+
+cat >> /etc/pbdc.conf << EOF
+BASE_DIR=$install_base
+BASE_LIB=$install_base/lib/
+BASE_DATA=$install_base/db/
+BACULA_USER="$user_id"
+
+export BACULA_USER BASE_DATA BASE_LIB BASE_DIR
+EOF
+
+cp -rp bin/* $install_base/bin
+cp -rp lib/* $install_base/lib
+chown -R $install_base
\ No newline at end of file