1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#!/bin/bash
#
# call this as root to restore the config after a failed update (which
# should not happen in the first place...)
#
# this restores the config files as if you had done a fresh install.
if test -d /tmp/powersave.sysconfig; then
echo "Backup directory /tmp/powersave.sysconfig already exists."
echo "Please remove it first."
exit 1
fi
rcpowersaved status >/dev/null 2>&1
if [ $? -eq 0 ] ; then
echo "powersaved is running, please stop it first."
exit 1
fi
echo "Moving directory /etc/sysconfig/powersave to /tmp/powersave.sysconfig:"
mv -v /etc/sysconfig/powersave /tmp/powersave.sysconfig
mkdir /etc/sysconfig/powersave
echo "Copying default configuration files to /etc/sysconfig/powersave:"
for file in scheme_acoustic scheme_performance scheme_powersave \
scheme_presentation events thermal battery sleep cpufreq common disk
do
cp -v /var/adm/fillup-templates/sysconfig.${file}-powersave \
/etc/sysconfig/powersave/${file}
done
echo "Please check the config files in /etc/sysconfig/powersave"
echo "and restart powersaved. Have a lot of fun..."
|