#!/usr/bin/env python import os import shutil skel_config="/usr/share/n4d-lliurexberry-server/berryterminal.skel" config_dir="/var/lib/tftpboot/ltsp/" config_file=config_dir+"berryterminal.ini" if not os.path.exists(config_dir): os.makedirs(config_dir) #if not os.path.exists(config_file): # Copy always! preventing using old file when session changes between updates try: shutil.copy(skel_config,config_file) except: pass f=open(config_file) lines=f.readlines() f.close() print "".join(lines)