- if ! id -g motion >/dev/null 2>&1; then + if [ ! "$(getent group motion)" ]; then
The original command doesn't work of course, but the second looks broken, too: Why do you use $() for grabbing the command output? I think you mean
if ! getent group motion >/dev/null; then
?
- if ! id -g motion >/dev/null 2>&1; then
+ if [ ! "$(getent group motion)" ]; then
The original command doesn't work of course, but the second looks broken, too: Why do you use $() for grabbing the command output? I think you mean
if ! getent group motion >/dev/null; then
?