#!/bin/bash
# Use vga_switcheroo to switch off unused video card.
# author : nah
# licence : WTFPL

# source rc.conf and rc.d.functions

. /etc/rc.conf
. /etc/rc.d/functions

stat_busy "Checking video card "

#mount debugfs to enable access to vga_switcheroo
mount -t debugfs none /sys/kernel/debug


# verify if exists /sys/kernel/debug/vgaswitcheroo
if [ -d /sys/kernel/debug/vgaswitcheroo ]
then
        stat_append "Disabling radeon card"
        # switch off unused card
        echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
fi

stat_done
