aboutsummaryrefslogtreecommitdiffstats
path: root/init-sh/grpuser
diff options
context:
space:
mode:
authorYoann Vandoorselaere <yoann@mandriva.com>1999-12-09 17:16:37 +0000
committerYoann Vandoorselaere <yoann@mandriva.com>1999-12-09 17:16:37 +0000
commita9246801e5bce8060b3086ae5f3d443699b82171 (patch)
tree087e90506e9630ee7dba5ef3960ca2cc7146162a /init-sh/grpuser
parent9422e4962af0d43308cfae95ab8e7370ee035525 (diff)
downloadmsec-a9246801e5bce8060b3086ae5f3d443699b82171.tar
msec-a9246801e5bce8060b3086ae5f3d443699b82171.tar.gz
msec-a9246801e5bce8060b3086ae5f3d443699b82171.tar.bz2
msec-a9246801e5bce8060b3086ae5f3d443699b82171.tar.xz
msec-a9246801e5bce8060b3086ae5f3d443699b82171.zip
Should really be stable now.
Diffstat (limited to 'init-sh/grpuser')
-rwxr-xr-xinit-sh/grpuser20
1 files changed, 10 insertions, 10 deletions
diff --git a/init-sh/grpuser b/init-sh/grpuser
index 408e384..fb2ad25 100755
--- a/init-sh/grpuser
+++ b/init-sh/grpuser
@@ -33,7 +33,7 @@ RemoveUserFromGroup() {
}
AppendUserToGroup() {
- if [ -z "${group_users}" ]; then
+ if [[ -z ${group_users} ]]; then
new_group_line=${group_line}${user_name}
else
new_group_line=${group_line}",${user_name}"
@@ -41,7 +41,7 @@ AppendUserToGroup() {
}
IsUserAlreadyInGroup() {
- if echo "${group_users}" | grep -qw "${user_name}"; then
+ if echo ${group_users} | grep -qw "${user_name}"; then
return 1
fi
@@ -66,7 +66,7 @@ IsGroupExisting() {
IsUserExisting() {
grep -qn "^${user_name}:" /etc/passwd
- if [ $? == 0 ]; then
+ if [[ $? == 0 ]]; then
return 0;
fi
@@ -75,20 +75,20 @@ IsUserExisting() {
Add() {
IsGroupExisting;
- if [ $? == 0 ]; then
+ if [[ $? == 0 ]]; then
echo "Sorry, group \"${group_name}\" does not exist."
echo "Please create it using the \"groupadd\" command."
exit 1
fi
IsUserExisting;
- if [ $? == 1 ]; then
+ if [[ $? == 1 ]]; then
echo "Sorry, user \"${user_name}\" does not exist."
exit 1
fi
IsUserAlreadyInGroup;
- if [ $? == 1 ]; then
+ if [[ $? == 1 ]]; then
echo "Sorry, user \"${user_name}\" is already in group \"${group_name}\"."
exit 1
fi
@@ -101,13 +101,13 @@ Add() {
Del() {
IsGroupExisting;
- if [ $? == 0 ]; then
+ if [[ $? == 0 ]]; then
echo "Sorry, group \"${group_name}\" does not exist."
exit 1
fi
IsUserAlreadyInGroup;
- if [ $? == 0 ]; then
+ if [[ $? == 0 ]]; then
echo "Sorry, user \"${user_name}\" is not in group \"${group_name}\"."
exit 1
fi
@@ -119,13 +119,13 @@ Del() {
}
Perm() {
- if [ ! -w /etc/${file} ]; then
+ if [[ ! -w /etc/${file} ]]; then
echo "You're not allowed to write to /etc/group..."
exit 1
fi
}
-if [ $# == 3 ]; then
+if [[ $# == 3 ]]; then
case $1 in
"--add")
Perm;