#Added by slkbuild 1.4
dotnew() {
        NEW="${1}.new"
        OLD="$1"
        if [ ! -e $OLD ]; then
                mv $NEW $OLD
        elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
                rm $NEW
        fi
}
dotnew etc/lsb-release
dotnew etc/HOSTNAME
dotnew etc/gtk-3.0/settings.ini
dotnew etc/gtk-2.0/gtkrc
doinst () 
{ 
    if [ -f usr/bin/lxterminal ]; then
        ( cd usr/bin;
        ln -sf lxterminal xterm );
    fi;
    if [ -f usr/bin/lsb_release-update ]; then
        sh usr/bin/lsb_release-update;
        sed -i "s/DISTRIB_RELEASE=.*/DISTRIB_RELEASE=8.0/g" etc/lsb-release;
    fi;
    if [ -r etc/rc.d/rc.pulseaudio ]; then
        chmod +x etc/rc.d/rc.pulseaudio;
    fi;
    if [ -r etc/rc.d/rc.cups ]; then
        chmod +x etc/rc.d/rc.cups;
    fi;
    if [ -f etc/rc.d/rc.local ]; then
        sed -i "s/#rfkill unblock all/rfkill unblock all/g" etc/rc.d/rc.local;
        sed -i "s/#amixer set Master 75% unmute/amixer set Master 75% unmute/g" etc/rc.d/rc.local;
    fi;
    if [ -f usr/share/applications/jconsole.desktop ]; then
        rm usr/share/applications/jconsole.desktop;
    fi;
    if [ -f usr/share/applications/policytool.desktop ]; then
        rm usr/share/applications/policytool.desktop;
    fi;
    if [ -f usr/share/applications/htop.desktop ]; then
        sed -i "s/Exec=\(.*\)/Exec=xterm -e \/usr\/bin\/htop/" usr/share/applications/htop.desktop;
    fi;
    if [ -f etc/profile ]; then
        cat >> etc/profile <<EOF
	
export QT_QPA_PLATFORMTHEME=qt5ct


# Fbpanel FLAG
if [[ "\$(locale | grep LANG | cut -d= -f2 | cut -d. -f1)" == "el_GR" ]] ; then
 if [ -f /etc/skel/.config/fbpanel/default-el ]; then
	cp /etc/skel/.config/fbpanel/default-el ~/.config/fbpanel/default
 fi
else
 if [ -f /etc/skel/.config/fbpanel/default-en ]; then
	cp /etc/skel/.config/fbpanel/default-en ~/.config/fbpanel/default
 fi
fi
EOF

    fi
}
doinst
