set-up / setup.sh
zulkifal-turing's picture
Update setup.sh
f647d54 verified
#!/bin/bash
# Setup script to initialize power profile to balanced mode
echo "Setting up power profile test environment..."
# Check if powerprofilesctl is available
if command -v powerprofilesctl &> /dev/null; then
echo "Using powerprofilesctl..."
powerprofilesctl set balanced
current_profile=$(powerprofilesctl get)
echo "Current power profile: $current_profile"
if [ "$current_profile" = "balanced" ]; then
echo "Setup completed successfully - power profile set to balanced"
else
echo "Setup failed - could not set power profile to balanced"
exit 1
fi
else
echo "powerprofilesctl not available, trying alternative methods..."
# Try using cpupower if available
if command -v cpupower &> /dev/null; then
echo "Using cpupower..."
cpupower frequency-set -g conservative
echo "Set CPU governor to conservative (power-saving mode)"
else
echo "No power management tools available"
echo "This is a simulation - assuming balanced mode is set"
fi
echo "Setup completed (using available tools)"
fi