diff options
author | An-Cheng Huang <ancheng@sydney.vyatta.com> | 2007-10-24 09:08:12 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@sydney.vyatta.com> | 2007-10-24 09:08:12 -0700 |
commit | b1fcb904eab1425d349fd7ab8d65b39c1bfb2e3f (patch) | |
tree | 9be9ff210eb7658ac14717caa9269e4b024cc5d3 /scripts/system | |
parent | c07bfa52d381abfa0177dc5940e142bc4252b7b8 (diff) | |
download | vyatta-cfg-system-b1fcb904eab1425d349fd7ab8d65b39c1bfb2e3f.tar.gz vyatta-cfg-system-b1fcb904eab1425d349fd7ab8d65b39c1bfb2e3f.zip |
fix sed command ordering
Diffstat (limited to 'scripts/system')
-rwxr-xr-x | scripts/system/vyatta_update_login_user.pl | 5 |
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); |