From: Michael Prokop Date: Thu, 14 Jun 2018 16:05:52 +0000 (+0200) Subject: grml-lock: run physlock with `-u` option only if it's supported X-Git-Tag: v2.8.1~4 X-Git-Url: https://git.grml.org/?a=commitdiff_plain;h=9248c3dc0c134d39f6ab70a71c000265d600f737;p=grml-scripts.git grml-lock: run physlock with `-u` option only if it's supported Closes grml/grml#87 Thanks: maximebuy for the bugreport --- diff --git a/usr_bin/grml-lock b/usr_bin/grml-lock index 673be73..ac05958 100755 --- a/usr_bin/grml-lock +++ b/usr_bin/grml-lock @@ -44,7 +44,12 @@ and therefore might not work as intended." 7 70 fi lock_desktop() { - sudo physlock -u "$USER" + # be backwards compatible, see https://github.com/grml/grml/issues/87 + if physlock --help 2>&1 | grep -q -- '-u user' ; then + sudo physlock -u "$USER" + else + sudo physlock + fi } is_passwd_set() {