Updater create addon backup folder if it was missing

made some folders in /var/run at boot
move /var/spool/cron to ramdisk and link to it
add the ramdisk default folder to makegraphs
This commit is contained in:
Arne Fitzenreiter
2008-10-03 11:15:51 +02:00
parent a58a3090e2
commit dd7d74eb65
3 changed files with 51 additions and 2 deletions

View File

@@ -16,6 +16,42 @@ case "$1" in
if [ ! -e $RRDLOG.bak/vnstat ]; then
mkdir -p $RRDLOG.bak/vnstat
fi
#
# create some folders
#
if [ ! -e /var/run/clamav ]; then
mkdir -p /var/run/clamav
chown clamav:clamav /var/run/clamav
fi
if [ ! -e /var/run/cups ]; then
mkdir -p /var/run/cups
fi
if [ ! -e /var/run/dbus ]; then
mkdir -p /var/run/dbus
fi
if [ ! -e /var/run/mysql ]; then
mkdir -p /var/run/mysql
chown mysql:mysql /var/run/mysql
fi
if [ ! -e /var/run/pluto ]; then
mkdir -p /var/run/pluto
chmod 700 /var/run/pluto
fi
if [ ! -e /var/run/saslauthd ]; then
mkdir -p /var/run/saslauthd
fi
#
# Move /var/spool/cron to ramdisk and make a symlink
#
if [ ! -L /var/spool/cron ]; then
cp -pR /var/spool/cron /var/log/rrd.bak/cron
mv /var/spool/cron /var/log/rrd/cron
ln -s /var/log/rrd/cron /var/spool/cron
fi
echo_ok
;;
stop)
$0 backup

View File

@@ -38,6 +38,11 @@ my %mainsettings = ();
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
if ( $mainsettings{'RRDLOG'} eq "" ){
$mainsettings{'RRDLOG'}="/var/log/rrd";
&General::writehash("${General::swroot}/main/settings", \%mainsettings);
}
sub updatehdddata{
my $disk = $_[0];
my $standby;