source: xdg-lliurex-dirs/trunk/fuentes/install/usr/bin/fix_owner_home @ 323

Last change on this file since 323 was 323, checked in by hectorgh, 5 years ago

adding project files

  • Property svn:executable set to *
File size: 687 bytes
Line 
1#!/usr/bin/env python
2import sys
3import os, os.path
4import pwd
5
6
7if len(sys.argv) != 4:
8        sys.exit(0)
9home = sys.argv[1]
10group = sys.argv[2]
11user = sys.argv[3]
12
13list_files = ['.config' ,'.gconf','.gnome2','.local','.mozilla','.Xauthority','.xsession','.ICEauthority','.bashrc','.bash_logout','.dmrc','.gtk-bookmarks','.lliurex-do','.profile','.pulse','.bash_history','.cache','.gvfs','.pulse-cookie','.esd_auth','.font-config','.hydrogen','.solfegerc']
14for aux_file in list_files:
15        aux_path = os.path.join(home,aux_file)
16        if os.path.exists(aux_path) and os.stat(aux_path).st_uid != pwd.getpwnam(user).pw_uid :
17                cmd = "chown -R " + user +":"+group +' "' + aux_path + '"'
18                os.system(cmd)
Note: See TracBrowser for help on using the repository browser.