--- /dev/null
+#!/bin/sh
+
+. scripts/functions
+
+$bperl \
+ -e "extract_resource('$conf/bacula-dir.conf', 'Client', '$HOST-fd')" \
+ > $tmp/1
+
+sed "s/$HOST-fd/test1-fd/" $tmp/1 >> $conf/bacula-dir.conf
+sed "s/$HOST-fd/test2-fd/" $tmp/1 >> $conf/bacula-dir.conf
+sed "s/$HOST-fd/test-rst-fd/" $tmp/1 >> $conf/bacula-dir.conf
+sed "s/$HOST-fd/test-bkp-fd/" $tmp/1 >> $conf/bacula-dir.conf
+
+cat <<EOF >> $conf/bacula-dir.conf
+Pool {
+ Name = Test
+ Pool Type = Backup
+ Recycle = yes # Bacula can automatically recycle Volumes
+ AutoPrune = yes # Prune expired volumes
+ Volume Retention = 365d # one year
+}
+Console {
+ Name = restricted
+ Password = xxx
+ JobAcl = *all*
+ ClientAcl = test1-fd, test2-fd
+ RestoreClientAcl = test-rst-fd
+ BackupClientAcl = test-bkp-fd
+ PoolAcl = *all*
+ CatalogAcl = *all*
+ FileSetAcl = *all*
+ CommandAcl = *all*
+ StorageAcl = *all*
+ WhereAcl = $tmp/test-bkp-fd-restore, $tmp/test1-fd-restore, $tmp/test-rst-fd-restore-1, $tmp/test-rst-fd-restore-2
+ DirectoryAcl = *all*
+ UserIdAcl = *all*
+}
+Console {
+ Name = restricted-bvfs1
+ Password = xxx
+ JobAcl = *all*
+ ClientAcl = test1-fd, test2-fd
+ RestoreClientAcl = test-rst-fd
+ PoolAcl = *all*
+ CatalogAcl = *all*
+ FileSetAcl = *all*
+ CommandAcl = *all*
+ StorageAcl = *all*
+ WhereAcl = $tmp/test-bkp-fd-restore, $tmp/test1-fd-restore, $tmp/test-rst-fd-restore-1, $tmp/test-rst-fd-restore-2
+ DirectoryAcl = *all*
+ UserIdAcl = *all*
+}
+Console {
+ Name = restricted-bvfs2
+ Password = xxx
+ JobAcl = *all*
+ RestoreClientAcl = test-rst-fd
+ PoolAcl = *all*
+ CatalogAcl = *all*
+ FileSetAcl = *all*
+ CommandAcl = *all*
+ StorageAcl = *all*
+ WhereAcl = $tmp/test-bkp-fd-restore, $tmp/test1-fd-restore, $tmp/test-rst-fd-restore-1, $tmp/test-rst-fd-restore-2
+ DirectoryAcl = *all*
+ UserIdAcl = *all*
+}
+Console {
+ Name = restricted-job
+ Password = xxx
+ JobAcl = $JobName
+ ClientAcl = *all*
+ PoolAcl = *all*
+ CatalogAcl = *all*
+ FileSetAcl = *all*
+ CommandAcl = *all*
+ StorageAcl = *all*
+ WhereAcl = *all*
+ DirectoryAcl = *all*
+ UserIdAcl = *all*
+}
+Console {
+ Name = restricted-client
+ Password = xxx
+ JobAcl = *all*
+ ClientAcl = $HOST-fd
+ PoolAcl = *all*
+ CatalogAcl = *all*
+ FileSetAcl = *all*
+ CommandAcl = *all*
+ StorageAcl = *all*
+ WhereAcl = *all*
+ DirectoryAcl = *all*
+ UserIdAcl = *all*
+}
+Console {
+ Name = restricted-clients
+ Password = xxx
+ JobAcl = *all*
+ ClientAcl = $HOST-fd, test1-fd
+ PoolAcl = *all*
+ CatalogAcl = *all*
+ FileSetAcl = *all*
+ CommandAcl = *all*
+ StorageAcl = *all*
+ WhereAcl = *all*
+ DirectoryAcl = *all*
+ UserIdAcl = *all*
+}
+Console {
+ Name = restricted-pool
+ Password = xxx
+ JobAcl = *all*
+ ClientAcl = *all*
+ PoolAcl = Test
+ CatalogAcl = *all*
+ FileSetAcl = *all*
+ CommandAcl = *all*
+ StorageAcl = *all*
+ WhereAcl = *all*
+ DirectoryAcl = *all*
+ UserIdAcl = *all*
+}
+Console {
+ Name = restricted-fileset
+ Password = xxx
+ JobAcl = *all*
+ ClientAcl = *all*
+ PoolAcl = *all*
+ CatalogAcl = *all*
+ FileSetAcl = "Full Set"
+ CommandAcl = *all*
+ StorageAcl = *all*
+ WhereAcl = *all*
+ DirectoryAcl = *all*
+ UserIdAcl = *all*
+}
+EOF
+
+cat <<EOF >> $tmp/bconsole.conf2
+Console {
+ Name = restricted
+ Password = xxx
+}
+EOF
+
+sed 's/Password.*/Password = xxx/' $conf/bconsole.conf >> $tmp/bconsole.conf2
+
+for i in job pool client clients fileset bvfs1 bvfs2
+do
+ sed "s/restricted/restricted-$i/" $tmp/bconsole.conf2 > $tmp/bconsole.conf.$i
+done
echo "$cwd/build/po" > $tmp/file-list
+export JobName HOST tmp conf
change_jobname NightlySave $JobName
-perl -Mscripts::functions \
- -e "extract_resource('$conf/bacula-dir.conf', 'Client', '$HOST-fd')" \
- > $tmp/1
-
-sed "s/$HOST-fd/test1-fd/" $tmp/1 >> $conf/bacula-dir.conf
-sed "s/$HOST-fd/test2-fd/" $tmp/1 >> $conf/bacula-dir.conf
-sed "s/$HOST-fd/test-rst-fd/" $tmp/1 >> $conf/bacula-dir.conf
-sed "s/$HOST-fd/test-bkp-fd/" $tmp/1 >> $conf/bacula-dir.conf
-
-cat <<EOF >> $conf/bacula-dir.conf
-Pool {
- Name = Test
- Pool Type = Backup
- Recycle = yes # Bacula can automatically recycle Volumes
- AutoPrune = yes # Prune expired volumes
- Volume Retention = 365d # one year
-}
-Console {
- Name = restricted
- Password = xxx
- JobAcl = *all*
- ClientAcl = test1-fd, test2-fd
- RestoreClientAcl = test-rst-fd
- BackupClientAcl = test-bkp-fd
- PoolAcl = *all*
- CatalogAcl = *all*
- FileSetAcl = *all*
- CommandAcl = *all*
- StorageAcl = *all*
- WhereAcl = $tmp/test-bkp-fd-restore, $tmp/test1-fd-restore, $tmp/test-rst-fd-restore-1, $tmp/test-rst-fd-restore-2
- DirectoryAcl = *all*
- UserIdAcl = *all*
-}
-Console {
- Name = restricted-bvfs1
- Password = xxx
- JobAcl = *all*
- ClientAcl = test1-fd, test2-fd
- RestoreClientAcl = test-rst-fd
- PoolAcl = *all*
- CatalogAcl = *all*
- FileSetAcl = *all*
- CommandAcl = *all*
- StorageAcl = *all*
- WhereAcl = $tmp/test-bkp-fd-restore, $tmp/test1-fd-restore, $tmp/test-rst-fd-restore-1, $tmp/test-rst-fd-restore-2
- DirectoryAcl = *all*
- UserIdAcl = *all*
-}
-Console {
- Name = restricted-bvfs2
- Password = xxx
- JobAcl = *all*
- RestoreClientAcl = test-rst-fd
- PoolAcl = *all*
- CatalogAcl = *all*
- FileSetAcl = *all*
- CommandAcl = *all*
- StorageAcl = *all*
- WhereAcl = $tmp/test-bkp-fd-restore, $tmp/test1-fd-restore, $tmp/test-rst-fd-restore-1, $tmp/test-rst-fd-restore-2
- DirectoryAcl = *all*
- UserIdAcl = *all*
-}
-Console {
- Name = restricted-job
- Password = xxx
- JobAcl = $JobName
- ClientAcl = *all*
- PoolAcl = *all*
- CatalogAcl = *all*
- FileSetAcl = *all*
- CommandAcl = *all*
- StorageAcl = *all*
- WhereAcl = *all*
- DirectoryAcl = *all*
- UserIdAcl = *all*
-}
-Console {
- Name = restricted-client
- Password = xxx
- JobAcl = *all*
- ClientAcl = $HOST-fd
- PoolAcl = *all*
- CatalogAcl = *all*
- FileSetAcl = *all*
- CommandAcl = *all*
- StorageAcl = *all*
- WhereAcl = *all*
- DirectoryAcl = *all*
- UserIdAcl = *all*
-}
-Console {
- Name = restricted-clients
- Password = xxx
- JobAcl = *all*
- ClientAcl = $HOST-fd, test1-fd
- PoolAcl = *all*
- CatalogAcl = *all*
- FileSetAcl = *all*
- CommandAcl = *all*
- StorageAcl = *all*
- WhereAcl = *all*
- DirectoryAcl = *all*
- UserIdAcl = *all*
-}
-Console {
- Name = restricted-pool
- Password = xxx
- JobAcl = *all*
- ClientAcl = *all*
- PoolAcl = Test
- CatalogAcl = *all*
- FileSetAcl = *all*
- CommandAcl = *all*
- StorageAcl = *all*
- WhereAcl = *all*
- DirectoryAcl = *all*
- UserIdAcl = *all*
-}
-Console {
- Name = restricted-fileset
- Password = xxx
- JobAcl = *all*
- ClientAcl = *all*
- PoolAcl = *all*
- CatalogAcl = *all*
- FileSetAcl = "Full Set"
- CommandAcl = *all*
- StorageAcl = *all*
- WhereAcl = *all*
- DirectoryAcl = *all*
- UserIdAcl = *all*
-}
-EOF
-
-cat <<EOF >> $tmp/bconsole.conf2
-Console {
- Name = restricted
- Password = xxx
-}
-EOF
+$rscripts/setup_rconsole
start_test
quit
EOF
-sed 's/Password.*/Password = xxx/' $conf/bconsole.conf >> $tmp/bconsole.conf2
-
-for i in job pool client clients fileset bvfs1 bvfs2
-do
- sed "s/restricted/restricted-$i/" $tmp/bconsole.conf2 > $tmp/bconsole.conf.$i
-done
-
# start the director
run_bacula