Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Set nullglob in tools/partition-disks
Browse files Browse the repository at this point in the history
So that this script can be run on LXC machines that don't have any "SCSI
disk" devices. Otherwise the glob doesn't get expanded and we try to run
`parted … /dev/sd?`. Example:

    vagrant@postgresql-slave-1:~$ for disk in /dev/sd?; do echo $disk; done
    /dev/sd?
    vagrant@postgresql-slave-1:~$ shopt -s nullglob
    vagrant@postgresql-slave-1:~$ for disk in /dev/sd?; do echo $disk; done
  • Loading branch information
dcarley committed Dec 18, 2014
1 parent d431fe5 commit 078fa61
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/partition-disks
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
set -e
shopt -s nullglob

for disk in /dev/sd?; do
echo "checking ${disk}"
if ! sudo parted -a optimal --script ${disk} -- print >/dev/null
Expand Down

0 comments on commit 078fa61

Please sign in to comment.