summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon2011-04-20 17:08:21 +0200
committerSimon2011-04-20 17:08:21 +0200
commit71e53c80aa1e4454a41bbf710c1f8501c4d1f03a (patch)
tree226d1c18bca73fa41000755119120a68fc802ef3
parentAutomatischer Start nach x Sekunden hinzugefügt (diff)
downloadpbs2-71e53c80aa1e4454a41bbf710c1f8501c4d1f03a.tar.gz
pbs2-71e53c80aa1e4454a41bbf710c1f8501c4d1f03a.tar.xz
pbs2-71e53c80aa1e4454a41bbf710c1f8501c4d1f03a.zip
Installer-Script erstellt
-rw-r--r--application/configs/application.ini.dist2
-rw-r--r--install.sh52
-rw-r--r--setup/pbs-newdata.sql74
-rw-r--r--setup/pbs.sql2
4 files changed, 84 insertions, 46 deletions
diff --git a/application/configs/application.ini.dist b/application/configs/application.ini.dist
index 64618e4..99e13a0 100644
--- a/application/configs/application.ini.dist
+++ b/application/configs/application.ini.dist
@@ -10,7 +10,7 @@ resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.params.displayExceptions = 0
resources.db.adapter = PDO_MYSQL
resources.db.params.host = localhost
-resources.db.params.username = root
+resources.db.params.username =
resources.db.params.password =
resources.db.params.dbname = pbs
resources.db.isDefaultTableAdapter = true
diff --git a/install.sh b/install.sh
new file mode 100644
index 0000000..7808dcc
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+#
+# Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
+# This program is free software distributed under the GPL version 2.
+# See http://gpl.openslx.org/
+#
+# If you have any feedback please consult http://feedback.openslx.org/ and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+
+# Absolute path to this script. /home/user/bin/foo.sh
+echo "Copying to /var/www/"
+sourceDir = dirname $0
+targetDir = "/var/www/pbs2/"
+cp -R $sourceDir $targetDir
+
+echo "Creating pbs2 host..."
+ln -s /usr/share/php/libzend-framework-php/Zend/ /var/www/pbs2/library/Zend
+cat > /etc/apache2/sites-available/pbs2 << EOF
+<VirtualHost *:80>
+ ServerName $domain
+ ServerAdmin admin@$domain
+ DocumentRoot /var/www/pbs2/public
+ <Directory /var/www/pbs2/public >
+ Options FollowSymLinks
+ AllowOverride All
+ </Directory>
+</VirtualHost>
+EOF
+
+echo "Enabling pbs2 host..."
+a2ensite pbs2
+echo "Restarting apache..."
+etc/init.d/apache2 restart
+
+echo "Creating config of pbs2..."
+cp /var/www/pbs2/application/configs/application.ini.dist /var/www/pbs2/application/configs/application.ini
+echo "Please enter the database user"
+read databaseuser
+sed -e 13s/$/$databaseuser/ -i /var/www/pbs2/application/configs/application.ini
+
+echo "Please enter the database password for user $databaseuser"
+read databasepassword
+sed -e 14s/$/$databasepassword/ -i /var/www/pbs2/application/configs/application.ini
+
+echo "Creating database and tables"
+mysql -u $databaseuser -p$databasepassword < /var/www/pbs2/setup/pbs.sql
+mysql -u $databaseuser -p$databasepassword < /var/www/pbs2/setup/pbs.sql
+
+echo "woho - pbs2 is ready to use"
+echo "You can reach your installed pbs2 server unter http://$domain/"
diff --git a/setup/pbs-newdata.sql b/setup/pbs-newdata.sql
index 18c197a..e648920 100644
--- a/setup/pbs-newdata.sql
+++ b/setup/pbs-newdata.sql
@@ -13,56 +13,45 @@ INSERT INTO `pbs_person` (`personID`, `title`, `name`, `firstname`, `street`, `h
-- Adding group
INSERT INTO `pbs`.`pbs_group` (`groupID` ,`title` ,`description`)VALUES
-(2, 'Group 2', 'Second Group'),
-(3, 'Group 3', 'Third Group'),
-(4, 'Group 4', 'Fourth Group'),
-(5, 'Group 5', 'Fifth Group'),
-(6, 'Group 6', 'Sixth Group'),
-(7, 'Group 7', 'Seventh Group'),
-(8, 'Group 8', 'Eight Group'),
-(9, 'Group 9', 'Nineth Group'),
-(10, 'Group 10', 'Tenth Group');
+(2, 'Germany', 'Deutschland'),
+(3, 'France', 'France'),
+(4, 'DFN', 'Deutsches Forschungsnetz'),
+(5, 'Institutionen', 'Fifth Group'),
+(6, 'Baden-Würtemberg', 'Sixth Group'),
+(7, 'Bayern', 'Seventh Group'),
+(8, 'Uni-Freiburg', 'Eight Group');
INSERT INTO `pbs`.`pbs_groupgroups` (`parentID`, `groupID`) VALUES
(1, 2),
(1, 3),
(2, 4),
(2, 5),
-(1, 8),
-(3, 6),
-(3, 7),
-(3, 9),
-(3, 10);
-
--- Adding role
-INSERT INTO `pbs`.`pbs_role` (`roleID`, `groupID`, `title`, `description`, `inheritance`) VALUES (7, '2', 'Role 1-Group2', NULL, 0);
-INSERT INTO `pbs`.`pbs_role` (`roleID`, `groupID`, `title`, `description`, `inheritance`) VALUES (8, '2', 'Role 2-Group2', NULL, 0);
-INSERT INTO `pbs`.`pbs_role` (`roleID`, `groupID`, `title`, `description`, `inheritance`) VALUES (9, '2', 'Role 3-Group2', NULL, 0);
-
-INSERT INTO `pbs_rightroles` (`roleID`, `rightID`) VALUES
-(7, 4),
-(7, 3),
-(8, 1),
-(9, 2);
+(5, 6),
+(5, 7),
+(6, 8);
-- Adding memberships
-INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`, `apikey`) VALUES (1, '1', '1', '1', 'apikey1');
-INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`, `apikey`) VALUES (2, '1', '2', '2', 'apikey2');
-INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`, `apikey`) VALUES (3, '2', '3', '1', 'apikey3');
-INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`, `apikey`) VALUES (4, '2', '4', '3', 'apikey4');
+INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`, `apikey`) VALUES (NULL, '1', '1', '1', 'apikey1');
+INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`, `apikey`) VALUES (NULL, '2', '1', '1', 'apikey2');
+INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`, `apikey`) VALUES (NULL, '3', '1', '1', 'apikey3');
+INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`, `apikey`) VALUES (NULL, '4', '1', '1', 'apikey4');
+INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`, `apikey`) VALUES (NULL, '5', '1', '1', 'apikey4');
+INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`, `apikey`) VALUES (NULL, '6', '1', '1', 'apikey4');
+INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`, `apikey`) VALUES (NULL, '7', '1', '1', 'apikey4');
+INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`, `apikey`) VALUES (NULL, '8', '1', '1', 'apikey4');
-- Adding clients
INSERT INTO `pbs_client` (`clientID`, `groupID`,`macadress`, `hardwarehash`) VALUES
-(1, 1, '00:00:00:00:00:10', 'ea9b82d9de911bc2d3cd23f53a6cab48'),
-(2, 1, '00:00:00:00:10:00', '1e2b1599710fbbef0dc789e8cfe12455'),
-(3, 1, '00:00:00:10:10:00', '8f6209ca3d6b35e223a11c249d1b69fc'),
-(4, 1, '00:00:10:00:00:00', 'e17ab09f3586464f19629e2e8b1e9a9d'),
-(5, 1, '00:10:00:00:00:00', '9bf70279d283b85440c2031c19bb6812'),
-(6, 1, '10:00:00:00:00:00', 'ad3bce4464a6267441ec144744439c7e'),
-(7, 1, '00:55:00:55:00:55', 'e8d7e80d79f224771b7a3a0af4e02748'),
-(8, 1, '66:00:66:00:66:00', 'ded66ce272f384e9e386c1b57ded3e4d'),
-(9, 1, '00:ff:ff:ff:ff:ff', '695610ee509c060b1fca9c8011529af4'),
-(10, 1, '00:22:00:22:00:22', 'a3562c8cad2a4fa4fc11656025dc911b'),
+(1, 1, 'a5:9a:0f:94:2a:b0', 'ea9b82d9de911bc2d3cd23f53a6cab48'),
+(2, 1, '91:91:f1:e2:99:aa', '1e2b1599710fbbef0dc789e8cfe12455'),
+(3, 1, '6e:5c:82:78:f2:39', '8f6209ca3d6b35e223a11c249d1b69fc'),
+(4, 1, '67:75:e9:f2:5f:8e', 'e17ab09f3586464f19629e2e8b1e9a9d'),
+(5, 1, '63:51:7e:22:aa:72', '9bf70279d283b85440c2031c19bb6812'),
+(6, 1, '68:9e:fe:47:95:c5', 'ad3bce4464a6267441ec144744439c7e'),
+(7, 1, '6e:1c:2e:01:77:33', 'e8d7e80d79f224771b7a3a0af4e02748'),
+(8, 1, 'd1:91:20:43:2f:dd', 'ded66ce272f384e9e386c1b57ded3e4d'),
+(9, 1, '1b:0f:a5:82:47:16', '695610ee509c060b1fca9c8011529af4'),
+(10, 1, '56:8e:7b:03:5f:98', 'a3562c8cad2a4fa4fc11656025dc911b'),
(11, 2, 'af:54:07:87:63:44', '98413218152196816519841365419816'),
(12, 2, '87:21:74:52:96:20', '98741298132516132169813516981616'),
(13, 2, '14:47:58:47:36:48', '32168132068132068513216053516513'),
@@ -70,11 +59,8 @@ INSERT INTO `pbs_client` (`clientID`, `groupID`,`macadress`, `hardwarehash`) VAL
-- Adding config
INSERT INTO `pbs_config` (`configID`, `title`, `groupID`, `membershipID`, `visible`, `created`) VALUES
-(1, 'Config 1', 1, null, '1', '1299693677'),
-(2, 'Config 2', 1, null, '0', '1299693690'),
-(3, 'Config 3', 1, null, '1', '1299693690'),
-(4, 'Config 4', null, 1, '1', '1299693690'),
-(5, 'Config 5', null, 1, '1', '1299693690');
+(1, 'Default Config', 1, null, '1', '1299693677'),
+(2, 'Config 2', null, 1, '1', '1299693690');
-- Adding bootosuser
INSERT INTO `pbs_bootosuser` (`bootosuserID`, `configID`, `login`, `password`, `homepath`, `hometypeID`) VALUES
diff --git a/setup/pbs.sql b/setup/pbs.sql
index 9eee1ab..8a59fbb 100644
--- a/setup/pbs.sql
+++ b/setup/pbs.sql
@@ -193,7 +193,7 @@ CREATE TABLE IF NOT EXISTS `pbs_bootmenu` (
KEY `membershipID` (`membershipID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
ALTER TABLE `pbs_bootmenu` ADD `startcounter` INT NOT NULL AFTER `title`;
-ALTER TABLE `pbs_bootmenu` CHANGE `startcounter` `startcounter` INT( 11 ) NOT NULL DEFAULT '300'
+ALTER TABLE `pbs_bootmenu` CHANGE `startcounter` `startcounter` INT( 11 ) NOT NULL DEFAULT '300';
ALTER TABLE `pbs_bootmenu`
ADD CONSTRAINT `pbs_bootmenu_ibfk_1` FOREIGN KEY (`membershipID`) REFERENCES `pbs_membership` (`membershipID`) ON DELETE SET NULL,