40 lines
1.2 KiB
Bash
40 lines
1.2 KiB
Bash
#!/bin/bash
|
|
APTMODE="debconf-apt-progress -- apt"
|
|
PKGM="$APTMODE"
|
|
PKGUD="$PKGM update"
|
|
PKGI="${PKGM} install -y"
|
|
|
|
|
|
# Precheck
|
|
if [ $UID != 0 ]; then
|
|
TERM=ansi whiptail --title "Info" --infobox "Please run as root!" 7 23
|
|
sleep 3
|
|
clear
|
|
exit
|
|
fi
|
|
|
|
# Check if package exists
|
|
which powertop > /dev/null 2>&1
|
|
if [ $? != 0 ]; then
|
|
# If package does not exist install powertop
|
|
TERM=ansi whiptail --title "Info" --infobox "Installing powertop" 7 23
|
|
sleep 3
|
|
$PKGUD
|
|
$PKGI powertop
|
|
fi
|
|
|
|
TERM=ansi whiptail --title "Info" --infobox "Configuring powertop" 7 24
|
|
sleep
|
|
wget https://git.ictcorpnet.com/b.waal/Snippets/raw/branch/main/Debian/Powertop/ptop.service -O /lib/systemd/system/powertop.service
|
|
TERM=ansi whiptail --title "Info" --infobox "Enabling powertop at startup." 7 35
|
|
systemctl daemon-reload
|
|
sleep 1
|
|
TERM=ansi whiptail --title "Info" --infobox "Enabling powertop at startup.." 7 35
|
|
systemctl enable powertop
|
|
sleep 1
|
|
TERM=ansi whiptail --title "Info" --infobox "Enabling powertop at startup..." 7 35
|
|
systemctl start powertop
|
|
sleep 1
|
|
|
|
TERM=ansi whiptail --title "Info" --msgbox "Setup finished! \n\nThe new settings are automaticly applied.\nNo need to reboot!" 11 45
|
|
clear |