summaryrefslogtreecommitdiff
path: root/scripts/system
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@sydney.vyatta.com>2007-10-24 09:08:12 -0700
committerAn-Cheng Huang <ancheng@sydney.vyatta.com>2007-10-24 09:08:12 -0700
commitb1fcb904eab1425d349fd7ab8d65b39c1bfb2e3f (patch)
tree9be9ff210eb7658ac14717caa9269e4b024cc5d3 /scripts/system
parentc07bfa52d381abfa0177dc5940e142bc4252b7b8 (diff)
downloadvyatta-cfg-system-b1fcb904eab1425d349fd7ab8d65b39c1bfb2e3f.tar.gz
vyatta-cfg-system-b1fcb904eab1425d349fd7ab8d65b39c1bfb2e3f.zip
fix sed command ordering
Diffstat (limited to 'scripts/system')
-rwxr-xr-xscripts/system/vyatta_update_login_user.pl5
1 files changed, 2 insertions, 3 deletions
diff --git a/scripts/system/vyatta_update_login_user.pl b/scripts/system/vyatta_update_login_user.pl
index f51b8001..d3e51593 100755
--- a/scripts/system/vyatta_update_login_user.pl
+++ b/scripts/system/vyatta_update_login_user.pl
@@ -81,7 +81,6 @@ sub remove_user_from_group {
# adds the specified user to group/gshadow
sub add_user_to_group {
my $user = shift;
-
my $gcmd = 'grep -q -e \'^' . $DEF_GROUP . ':.*[:,]' . $user . '\(,\|$\)\'';
my $ret = system("$gcmd /etc/group");
my $in_group = (($ret >> 8) == 0) ? 1 : 0;
@@ -89,8 +88,8 @@ sub add_user_to_group {
my $in_gshadow = (($ret >> 8) == 0) ? 1 : 0;
my $sed_cmd = 'sed -i \'/^' . $DEF_GROUP . ':/{'
- . 's/:$/:' . $user . '/;'
- . 's/\([^:]\)$/\1,' . $user . '/;}\'';
+ . 's/\([^:]\)$/\1,' . $user . '/;'
+ . 's/:$/:' . $user . '/;}\'';
if (!$in_group) {
system("$sed_cmd /etc/group");
exit 1 if ($? >> 8);