diff options
author | Jenya Sovetkin | 2017-10-27 16:46:20 +0200 |
---|---|---|
committer | Jenya Sovetkin | 2017-10-27 16:46:20 +0200 |
commit | b2c87aa33c4af2bb4a2bb80f1850b6e8cfe3651e (patch) | |
tree | b131cc61a8fa0d7dc5b3c5eb737f020ff577bd9d /openswap.hook | |
parent | a44a836f208d80216087b6187424b2facb5031b7 (diff) | |
download | aur-b2c87aa33c4af2bb4a2bb80f1850b6e8cfe3651e.tar.gz |
fixing path and racing condition
Diffstat (limited to 'openswap.hook')
-rw-r--r-- | openswap.hook | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/openswap.hook b/openswap.hook index 9aad79a29c2d..9a96ad4b3ced 100644 --- a/openswap.hook +++ b/openswap.hook @@ -1,7 +1,15 @@ run_hook () { ## read openswap configurations - source openswap.conf + source /openswap.conf + + ## Optional: To avoid race conditions + x=0; + while [ ! -b "$keyfile_device" ] && [ $x -le 10 ]; do + x=$((x+1)) + sleep .2 + done + ## End of optional if [ -z "$keyfile_device" ] || [ -z "$keyfile_filename" ] then |