about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-06-29 02:14:39 +0200
committerManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-06-29 02:14:39 +0200
commitc68bc92adf2753df4ea1489efa2b72b9f3d97581 (patch)
tree7bf16cd6749bf230e385266fa83e982ec415f605
parentComplete rewrite, many improvements (diff)
downloadsmart-wallpaper-c68bc92adf2753df4ea1489efa2b72b9f3d97581.tar.gz
smart-wallpaper-c68bc92adf2753df4ea1489efa2b72b9f3d97581.tar.bz2
smart-wallpaper-c68bc92adf2753df4ea1489efa2b72b9f3d97581.zip
Fixed a bug that prevented the script from exiting
-rwxr-xr-xsmart-wallpaper14
1 files changed, 8 insertions, 6 deletions
diff --git a/smart-wallpaper b/smart-wallpaper
index 576d76a..c96e166 100755
--- a/smart-wallpaper
+++ b/smart-wallpaper
@@ -17,16 +17,18 @@ print_usage() {
 
 if (( $# == 0 )); then
     print_usage
+    exit 1
 fi
 
 while getopts 'd:n:l:h' flag; do
   case "${flag}" in
-    d) input_daytimewallpaper="${OPTARG}";;
-    n) input_nighttimewallpaper="${OPTARG}";;
-    l) location="${OPTARG}";;
-    h) print_usage                ;;
+    d) input_daytimewallpaper="${OPTARG}"    ;;
+    n) input_nighttimewallpaper="${OPTARG}"  ;;
+    l) location="${OPTARG}"                  ;;
+    h) print_usage
+       exit 0                                ;;
     *) print_usage
-       exit 1                     ;;
+       exit 1                                ;;
   esac
 done
 
@@ -62,5 +64,5 @@ do
     fi
   fi
 
-  sleep 500
+  sleep 500s
 done