o
    !Ôcd  ã                   @   s‚   d dl Z d dlZd dlZd dlZej dd¡Ze j d e¡ d dlZd dl	Z	dd„ Z
dd„ Zedkr?e ¡ ZdZeeeƒ dS dS )	é    Nz/home/psgendb/BIRCHDEVÚscriptc                 C   sh   t | dƒ}| ¡ }| ¡  |D ]"}tj |¡rt |d¡ t |dƒ}| |¡ | ¡  t |d¡ qd S )NÚriÀ  za+)ÚopenÚ	readlinesÚcloseÚosÚpathÚexistsÚchmodÚ
writelines)Úsource_fileÚ
dest_filesÚsrc_fileÚlinesr   Údest_h© r   ú,/home/birch/BIRCH/install-scripts/newuser.pyÚbirchappend,   s   


úr   c                 C   s  t dƒ tj d¡}t dƒ tj |d¡g}ttj | dd¡|ƒ t dƒ tj |d¡tj |d	¡g}ttj | dd
¡|ƒ t dƒ tj |d¡tj |d¡tj |d¡tj |d¡tj |d¡g}ttj | dd¡|ƒ t dƒ t | ¡ t dƒ t | |¡ t dƒ t dƒ d S )Nzgetting home directoryú~zWriting .loginz.loginÚadminÚadd_to_loginzWriting .cshrc & .tcshrcz.cshrcz.tcshrcÚadd_to_cshrcz:Writing Bourne Shell .profile, .bash_profile, .zshrc, etc.z.profilez.bash_profilez.bash_loginz.bashrcz.zshrcÚadd_to_profilezSetting up VNCzCreating launcher linkszDone - newuser.py!z;Logout and login again so that the changes can take effect.)	Úprintr   r   Ú
expanduserÚjoinr   ÚvncsetupÚlinklauncherÚmain)ÚBIRCHÚPLATFORMÚHOMEÚFILELISTr   r   r   Únewuser;   s,   ü
r#   Ú__main__)Úsysr   Úos.pathÚplatformr   r   Ú	pathtoaddÚinsertr   r   r   r#   Ú__name__Úsystemr    r   r   r   r   r   Ú<module>   s     #ü