Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
3eadc480
Commit
3eadc480
authored
Dec 22, 2000
by
Leigh B. Stoller
Browse files
Minor fixes to regular expressions.
parent
e9005e54
Changes
2
Hide whitespace changes
Inline
Side-by-side
tmcd/freebsd/setup
View file @
3eadc480
...
...
@@ -66,7 +66,7 @@ if ($_ =~ /^FREE/) {
print
STDOUT
"
Free!
\n
";
exit
(
0
);
}
if
(
$_
=~
/ALLOCATED=(
\w*)\/(\w
*)/
)
{
if
(
$_
=~
/ALLOCATED=(
[-\@\w.]*)\/([-\@\w.]
*)/
)
{
print
STDOUT
"
Allocated: $1/$2!
\n
";
$project
=
$
1
;
}
...
...
@@ -190,7 +190,7 @@ open(TM, "$TMCC $NODE $ACCTCMD |")
or
die
"
Cannot start
$TMCC
: $!
";
while
(
<
TM
>
)
{
if
(
$_
=~
/^ADDGROUP NAME=([
0-9a-zA-Z
]+) GID=([0-9]+)/
)
{
if
(
$_
=~
/^ADDGROUP NAME=([
-\@\w.
]+) GID=([0-9]+)/
)
{
print
STDOUT
"
Group: $1/$2
\n
";
$group
=
$
1
;
...
...
@@ -219,16 +219,24 @@ while (<TM>) {
$name
=
$
1
;
}
print
STDOUT
"
User:
$login
/
$uid
/
$gid
/
$root
/
$name
\n
";
(
$exists
)
=
getpwuid
(
$uid
);
if
(
$exists
)
{
if
(
$root
)
{
$GLIST
=
"
-G wheel,
$gid
";
}
else
{
$GLIST
=
"
-G
$gid
";
}
system
("
$PW
usermod
$login
$GLIST
");
next
;
}
$GLIST
=
"
";
if
(
$root
)
{
$GLIST
=
"
-G wheel
";
$GLIST
=
"
-G wheel
";
}
if
(
system
("
$PW
useradd
$login
-u
$uid
-g
$gid
$GLIST
"
.
"
-d /users/
$login
-s /bin/tcsh -c
\"
$name
\"
")
!=
0
)
{
print
STDERR
"
Error adding new user
$login
\n
";
...
...
tmcd/linux/setup
View file @
3eadc480
...
...
@@ -19,6 +19,7 @@ my $DELAYCMD = "delay";
my
$IFCONFIG
=
"
/sbin/ifconfig eth%d inet %s netmask %s
\n
";
my
$CP
=
"
/bin/cp -f
";
my
$USERADD
=
"
/usr/sbin/useradd
";
my
$USERMOD
=
"
/usr/sbin/usermod
";
my
$GROUPADD
=
"
/usr/sbin/groupadd
";
my
$IFACE
=
"
eth
";
my
$CTLIFACE
=
"
eth4
";
...
...
@@ -66,7 +67,7 @@ if ($_ =~ /^FREE/) {
print
STDOUT
"
Free!
\n
";
exit
(
0
);
}
if
(
$_
=~
/ALLOCATED=(
\w*)\/(\w
*)/
)
{
if
(
$_
=~
/ALLOCATED=(
[-\@\w.]*)\/([-\@\w.]
*)/
)
{
print
STDOUT
"
Allocated: $1/$2!
\n
";
$project
=
$
1
;
}
...
...
@@ -122,7 +123,7 @@ open(TM, "$TMCC $NODE $ACCTCMD |")
or
die
"
Cannot start
$TMCC
: $!
";
while
(
<
TM
>
)
{
if
(
$_
=~
/^ADDGROUP NAME=([
0-9a-zA-Z
]+) GID=([0-9]+)/
)
{
if
(
$_
=~
/^ADDGROUP NAME=([
-\@\w.
]+) GID=([0-9]+)/
)
{
print
STDOUT
"
Group: $1/$2
\n
";
$group
=
$
1
;
...
...
@@ -151,8 +152,16 @@ while (<TM>) {
$name
=
$
1
;
}
print
STDOUT
"
User:
$login
/
$uid
/
$gid
/
$root
/
$name
\n
";
(
$exists
)
=
getpwuid
(
$uid
);
if
(
$exists
)
{
if
(
$root
)
{
$GLIST
=
"
-G root,
$gid
";
}
else
{
$GLIST
=
"
-G
$gid
";
}
system
("
$USERMOD
$GLIST
$login
");
next
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment