Ask / Submit
1

How to check if Dev mode activated ? [answered]

asked 2014-09-19 23:19:33 +0300

Schturman gravatar image

updated 2014-09-20 08:59:03 +0300

molan gravatar image

Can I somehow check via CLI if Dev mode activated now or not ?

Thanks

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by molan
close date 2014-09-20 08:58:21.156365

2 Answers

Sort by » oldest newest most voted
2

answered 2014-09-19 23:36:58 +0300

rainisto gravatar image

updated 2014-09-21 11:40:15 +0300

ls /usr/bin/devel-su

Return value 0 tells that its activated and return value 2 says that file doesn't exist so its disabled :)

# ls /usr/bin/devel-su > /dev/null 2>&1
# echo $?

or

# if ls /usr/bin/devel-su > /dev/null 2>&1; then echo enabled; else echo disabled; fi

or even faster without ls (thanks @pycage)

# [ -x /usr/bin/devel-su ] && echo enabled || echo disabled
edit flag offensive delete publish link more

Comments

thanks, already found another way :)

Schturman ( 2014-09-19 23:39:22 +0300 )edit

well yes you can do it with rpm, but rpm query will take ~700ms and ls query will take ~20ms, so if you want to have faster check you use ls.

rainisto ( 2014-09-19 23:43:23 +0300 )edit

Yep, in this way much better :) Thanks again!

P.S. Don't know how to convert your comment to answer, sorry :)

Schturman ( 2014-09-20 00:02:37 +0300 )edit
1

Or shorter with test ([) instead of having ls fail:

[ -x /usr/bin/devel-su ] && echo enabled || echo disabled
pycage ( 2014-09-21 11:18:55 +0300 )edit

Thanks :)

Schturman ( 2014-09-21 13:12:19 +0300 )edit
0

answered 2014-09-19 23:38:30 +0300

Schturman gravatar image

updated 2014-09-19 23:52:46 +0300

Never mind, I checked by installed packages:

rpm -qa jolla-developer*
edit flag offensive delete publish link more

Question tools

Follow
1 follower

Stats

Asked: 2014-09-19 23:19:33 +0300

Seen: 337 times

Last updated: Sep 21 '14