File: restore_default_config

package info (click to toggle)
powersave 0.14.0-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,764 kB
  • ctags: 999
  • sloc: sh: 11,357; cpp: 8,103; ansic: 2,631; makefile: 388
file content (31 lines) | stat: -rw-r--r-- 1,099 bytes parent folder | download | duplicates (2)
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..."