Mercurial > pkg
comparison src/pkg.pl @ 4:fe56b4698cf8
add install-init, and refine pkg.pl.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 08 Jan 2013 15:41:29 +0000 |
parents | 9ff0fcf34920 |
children | ab4011ea1463 |
comparison
equal
deleted
inserted
replaced
3:9ff0fcf34920 | 4:fe56b4698cf8 |
---|---|
68 ("groupadd", "--force", $pkg_name); | 68 ("groupadd", "--force", $pkg_name); |
69 | 69 |
70 @pkg_create_home_cmd = | 70 @pkg_create_home_cmd = |
71 ("install", "-d", "-g", $pkg_name, "-o", $pkg_name, "-m", "700", $pkg_home); | 71 ("install", "-d", "-g", $pkg_name, "-o", $pkg_name, "-m", "700", $pkg_home); |
72 | 72 |
73 sub execute{print "@_\n"; system(@_) and die $!;} | 73 sub execute{print "\t@_\n"; system(@_) and die $!;} |
74 | 74 |
75 #determine if the user already exists: | 75 #determine if the user already exists: |
76 `id $pkg_name 2>/dev/null`; | 76 `id $pkg_name 2>/dev/null`; |
77 if (!$?){execute(@pkg_switch_cmd); exit 0;} | 77 if (!$?){ |
78 print "Change user.\n"; | |
79 execute(@pkg_switch_cmd); exit 0;} | |
78 | 80 |
79 print "Creating package group.\n"; | 81 print "Creating package group.\n"; |
80 execute(@pkg_create_group_cmd); | 82 execute(@pkg_create_group_cmd); |
81 | 83 |
82 print "Creating package user.\n"; | 84 print "Creating package user.\n"; |