I want part of my bash script to only be executable if there's a certain grep match.
Here's what I want in the if clause:
Code:
install -m644 -D ${srcdir}/${pkgname}.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset || return 1
install -m644 -D ${srcdir}/mkinitcpio-${pkgname}.conf ${pkgdir}/etc/mkinitcpio-zen.conf || return 1
Disregard the variables.
Here's the grep line:
Code:
grep -F CONFIG_BLK_DEV_INITRD=y /path/to/file
I haven't added the correct path.
I want it to look like this, but I don't know how to state it:
Code:
if grep -F CONFIG_BLK_DEV_INITRD=y /path/to/file
install -m644 -D ${srcdir}/${pkgname}.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset || return 1
install -m644 -D ${srcdir}/mkinitcpio-${pkgname}.conf ${pkgdir}/etc/mkinitcpio-zen.conf || return 1
fi