# -*-coding:utf-8 -*-
import os


class PublicItems:
    def __init__(self):
        pass
    noarch_post_script = 'sed -i "s/chage -d 0/chage -d `date +%Y-%m-%d`/g" /etc/EulerOS_init.sh; ' \
                         'sed -i "s/chage -d 0/chage -d `date +%Y-%m-%d`/g" ' \
                         '/opt/reinforce_os/reinforce_script/014.Add_and_Modify_User.sh; ' \
                         'if [ -f /etc/EulerOS_init.sh ];then sh /etc/EulerOS_init.sh; ' \
                         'else sh /opt/reinforce_os/reinforce_os.sh install; fi; chage -d `date +%Y-%m-%d` root'


class X86Euler:
    def __init__(self):
        pass

    @staticmethod
    def euler_install_packages():
        file_name = "rpmlist_x86"
        file_path = os.path.realpath(__file__ + '../../' + file_name)
        with open(file_path, 'r') as f:
            euler_install_packages = f.read()
        return euler_install_packages.strip("\n").split('\n')

    @staticmethod
    def ks_script():
        file_path = os.path.realpath(__file__ + '../../euleros_x86_ks.cfg')
        with open(file_path, 'r') as ks_file:
            _ks_script = ks_file.read()
        return _ks_script
