Skip to content

Commit 500642f

Browse files
Luap99dustymabe
authored andcommitted
fix script syntax
[ $osname !~ rhcos|fedora-coreos ] is not valid shell, !~ will resolve to the last entry in the shell history using "~". There is no match for saying NOT regex. Failure from the logs: custom-coreos-disk-images.sh: line 82: [: missing `]' custom-coreos-disk-images.sh: line 82: fedora-coreos: command not found Given we just have two values use two normal != conditions to match. Signed-off-by: Paul Holzinger <[email protected]>
1 parent e14cbea commit 500642f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

custom-coreos-disk-images.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ main() {
7979
--osname)
8080
shift # The arg is next in position args
8181
osname=$1
82-
if [ $osname !~ rhcos|fedora-coreos ]; then
82+
if [ "$osname" != rhcos ] && [ "$osname" != fedora-coreos ]; then
8383
echo "--osname must be rhcos or fedora-coreos" >&2
8484
exit 1
8585
fi

0 commit comments

Comments
 (0)