# [solved] detection if my ThinkPad is in a docking station

## toralf

I'm looking for a quick and simple test to check for it (b/c depending on that I either start ppp0 or wlan0) via /etc/conf.d/netLast edited by toralf on Fri Jan 29, 2010 5:08 pm; edited 1 time in total

----------

## krinn

something like ifplugd ?

----------

## doctork

On my t61, it appears that flags get set in 

```
/sys/bus/platform/devices/dock.?
```

They may tell you what you need to know.

--

doc

----------

## toralf

 *doctork wrote:*   

> On my t61, it appears that flags get set in 
> 
> ```
> /sys/bus/platform/devices/dock.?
> ```
> ...

 works, thx

btw ifplugd is more complicated then a simple 

```
[[ "$(cat /sys/bus/platform/devices/dock.0/docked)" = "1" ]] && ...
```

----------

## depontius

Spiffy!  I've been wondering this type of thing for a while, too.

```
user@localhost ~ $ ls /sys/bus/platform/devices/dock.*

/sys/bus/platform/devices/dock.0:

docked  flags  modalias  power  subsystem  type  uevent  uid  undock

/sys/bus/platform/devices/dock.1:

docked  flags  modalias  power  subsystem  type  uevent  uid  undock

/sys/bus/platform/devices/dock.2:

docked  flags  modalias  power  subsystem  type  uevent  uid  undock
```

and

```
user@localhost ~ $ cat /sys/bus/platform/devices/dock.*/type 

dock_station

battery_bay

ata_bay
```

I guess I'm docked, and there's something (DVD/CD-RW) in my ATA bay.  But the battery is out, because I'm running on mains and take it out normally for that.

----------

