[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2562] trunk/install-mycompany.sh



Revision: 2562
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2562&view=rev
Author:   jfkw
Date:     2009-04-14 19:01:22 +0000 (Tue, 14 Apr 2009)

Log Message:
-----------
Remove install-mycompany.sh hardcoded /path/to/ledgersmb, use pwd.

Modified Paths:
--------------
    trunk/install-mycompany.sh

Modified: trunk/install-mycompany.sh
===================================================================
--- trunk/install-mycompany.sh	2009-04-14 16:10:14 UTC (rev 2561)
+++ trunk/install-mycompany.sh	2009-04-14 19:01:22 UTC (rev 2562)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+CWD=`pwd`
+
 echo 'This script will create a mycompany dataset per INSTALL. Ctrl-C to cancel.'
 
 dropdb -i -U postgres mycompany ; 
@@ -7,30 +9,30 @@
 dropuser -U postgres myuser ; 
 createdb -U postgres -O ledgersmb mycompany ; 
 createlang plpgsql mycompany ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/Pg-database.sql ;
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Drafts.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/chart.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Account.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Session.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Business_type.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Location.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Company.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Customer.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Date.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Defaults.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Settings.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Employee.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Entity.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Payment.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Person.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Report.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Voucher.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Reconciliation.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Inventory.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Vendor.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/coa/us/chart/General.sql
-sed -e "s/<?lsmb dbname ?>/mycompany/g" /path/to/ledgersmb13/sql/modules/Roles.sql > /path/to/ledgersmb13/mycompany_roles.sql ; 
-psql -U postgres -d mycompany -f /path/to/ledgersmb13/mycompany_roles.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/Pg-database.sql ;
+psql -U postgres -d mycompany -f $CWD/sql/modules/Drafts.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/chart.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Account.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Session.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Business_type.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Location.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Company.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Customer.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Date.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Defaults.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Settings.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Employee.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Entity.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Payment.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Person.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Report.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Voucher.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Reconciliation.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Inventory.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/modules/Vendor.sql ; 
+psql -U postgres -d mycompany -f $CWD/sql/coa/us/chart/General.sql
+sed -e "s/<?lsmb dbname ?>/mycompany/g" $CWD/sql/modules/Roles.sql > $CWD/mycompany_roles.sql ; 
+psql -U postgres -d mycompany -f $CWD/mycompany_roles.sql ; 
 createuser --no-superuser --createdb --no-createrole -U postgres --pwprompt --encrypted myuser ; 
 psql -U postgres -d mycompany -t -c "INSERT INTO entity (name, entity_class, created) VALUES ('myuser', 3, NOW()) RETURNING name, entity_class, created;" ; 
 psql -U postgres -d mycompany -t -c "INSERT INTO person (entity_id, first_name, last_name, created) VALUES (2, 'Firstname', 'Lastname', NOW()) RETURNING entity_id, first_name, last_name, created;" ; 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.