Skip to content

Consider allowing -t to be supplied more than once #119

@chrishoage

Description

@chrishoage

Currently if supplying multiple -t flags the last one wins and that device is spun down

hd-idle/main.go

Lines 182 to 193 in 44c8db6

if singleDiskMode {
if err := spindownDisk(
disk,
config.Defaults.CommandType,
config.Defaults.PowerCondition,
config.Defaults.Debug,
); err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
os.Exit(0)
}

It would be convenient to be able to specify -t multiple times so that multiple devices could be spun down with out needing to invoke the command multiple times.

example:

sudo hd-idle -t /dev/disk/by-id/ata-HGST_HDN724040ALE640_PK2334PEK4AXTT -t /dev/disk/by-id/ata-HGST_HDN724040ALE640_PK1334PEKDXVTS

if any of the devices fail, exit 1 (even if some succeeded). Print the error.

If all devices succeed, exit 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions