#!/bin/bash

os=`cat /proc/cmdline | sed 's/.*os=\([^ ]*\).*/\1/'`
if [ $os == "40" ];then
    # 40 don't set bonding
    sed 's/^\.\/set_bonding/\#\.\/set_bonding/g' /mnt/opt/StateGrid/setup.sh > /mnt/opt/StateGrid/setup.sh.bak
    mv /mnt/opt/StateGrid/setup.sh.bak /mnt/opt/StateGrid/setup.sh
    chmod +x /mnt/opt/StateGrid/setup.sh
    # change desktop pic
    echo "cp /opt/StateGrid/install_shell/kdesktoprc \$USER_HOME/.kde/share/config/" >> /mnt/opt/StateGrid/install_shell/create_users.sh
    echo "cp /opt/StateGrid/install_shell/kdesktoprc \$HOME/.kde/share/config/" >> /mnt/opt/StateGrid/install_shell/create_users.sh
    echo "cp /opt/StateGrid/install_shell/kdesktoprc /etc/skel/.kde/share/config/" >> /mnt/opt/StateGrid/install_shell/create_users.sh
    echo "chown sys:sys /etc/skel/.kde/share/config/kdesktoprc" >> /mnt/opt/StateGrid/install_shell/create_users.sh
    echo "chown \$USER_NAME:\$USER_NAME \$USER_NAME/.kde/share/config" >> /mnt/opt/StateGrid/install_shell/create_users.sh
    # change issue
    sed 's/6\.0\.42\.41/4\.2\.40/g' /mnt/etc/issue > /mnt/etc/issue.bak
    mv /mnt/etc/issue.bak /mnt/etc/issue
fi
