summaryrefslogblamecommitdiff
path: root/install
blob: d16dbfa91dd0b7cf75960f938baae8f901fe6366 (plain) (tree)



























                                                                                                   
#!/bin/sh

# backup... tjust in case...
echo "Backup of firewall.local -> $PWD/data/backups/firewall.$(date +"%Y_%m_%d_%I_%M_%p_%s").local"
mkdir -p $PWD/data/backups
cp /etc/sysconfig/firewall.local $PWD/data/backups/firewall.$(date +"%Y_%m_%d_%I_%M_%p_%s").local

# Another backup!
echo "Backup of firewall.local -> firewall.local.old"
cp -PL /etc/sysconfig/firewall.local /etc/sysconfig/firewall.local.old

# iterator

if [[ ! -L "/etc/sysconfig/firewall.local" ]] ; then
    echo "Linking IPFire Custom Firewall Rules Looper"
    echo "Installing $PWD/data/executable/firewall.local -> /etc/sysconfig/firewall.local"
    rm /etc/sysconfig/firewall.local
    cp $PWD/data/originals/firewall.looper $PWD/data/run/firewall.local
    ln -s $PWD/data/run/firewall.local /etc/sysconfig/firewall.local
fi

# rules!

if [[ ! -L "/etc/sysconfig/rules.d" ]] ; then
    echo "Linking IPFire Custom Firewall Rules"
    echo "Installing $PWD/rules.d/ -> /etc/sysconfig/rules.d"
    ln -s $PWD/rules.d /etc/sysconfig/rules.d
fi