[arch-projects] [mkinitcpio] [PATCH 2/2] hooks/resume: Remove grep usage
Dave Reisner
d at falconindy.com
Mon Nov 14 19:10:18 EST 2011
On Mon, Nov 14, 2011 at 08:46:24PM -0300, Gerardo Exequiel Pozzi wrote:
> Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386 at yahoo.com.ar>
> ---
> hooks/resume | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hooks/resume b/hooks/resume
> index c0fa0e1..e216f42 100644
> --- a/hooks/resume
> +++ b/hooks/resume
> @@ -2,7 +2,7 @@
> run_hook ()
> {
> if [ -n "${resume}" ]; then
> - if echo ${resume} | grep -q ':'; then
> + if [ "${resume}" != "${resume/:}" ]; then
> # Tux-on-ice syntax: swap:/dev/sda2 or file:/dev/sda2:0xdeadbeef
> resumedev="$(echo ${resume} | cut -d: -f2)"
> else
> @@ -10,7 +10,7 @@ run_hook ()
> resumedev="${resume}"
> fi
> if poll_device "${resumedev}" ${rootdelay}; then
> - if echo ${resume} | grep -q ':'; then
> + if [ "${resume}" != "${resume/:}" ]; then
> # Try resuming with tuxonice
> tuxoniceroot="/sys/power/tuxonice"
> if [ -d "${tuxoniceroot}" ]; then
> --
> 1.7.7.3
>
Ack.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/arch-projects/attachments/20111114/66bc8eb3/attachment.asc>
More information about the arch-projects
mailing list