Used sequpgrade.sh to upgrade existing seqs

This commit is contained in:
2022-05-29 20:58:23 +02:00
parent 10ee4198f0
commit 6214493c18
57 changed files with 802 additions and 806 deletions

View File

@@ -12,7 +12,7 @@ CONFIG=0
CONFIG_FILE_NAME="${toolName}.cfg"
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
step_config() {
seq_config() {
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
if [ $? -eq 0 ] ; then
CONFIG=1
@@ -20,7 +20,7 @@ step_config() {
}
step_1_info() { echo "$toolName installation"; }
step_1_alias() { ALIAS="install"; }
step_1_alias() { echo "install"; }
step_1() {
exe apt update
exe apt install $toolDeps
@@ -137,9 +137,9 @@ step_20() {
}
step_80_info() { echo -e "Some ldap command notes\n"; }
step_80_alias() { ALIAS="notes"; }
step_80_alias() { echo "notes"; }
step_80() {
outColor green
color green
cat <<NOTES_EOF
# You can also check LDAP Base DN using the ldapsearch command as shown below
ldapsearch -H ldapi:/// -x -LLL -s base -b "" namingContexts
@@ -162,7 +162,7 @@ NOTES_EOF
}
step_100_info() { echo "Add group <GROUP NAME> <USER ID>"; }
step_100_alias() { ALIAS="addgroup"; }
step_100_alias() { echo "addgroup"; }
step_100() {
shift
local groupName=$1
@@ -178,7 +178,7 @@ member: \${memberDn}
"
step_102_info() { echo "Add user <USER ID> <USER NAME> <USER LASTNAME> <UIDNUMBER> <USER EMAIL> [USER GID]"; }
step_102_alias() { ALIAS="adduser"; }
step_102_alias() { echo "adduser"; }
step_102() {
shift
userId="$1"
@@ -215,7 +215,7 @@ loginShell: /bin/bash
"
step_103_info() { echo "(re)Set passwort for <USER>"; }
step_103_alias() { ALIAS="passwd"; }
step_103_alias() { echo "passwd"; }
step_103() {
shift
if [ ! -z $1 ] ; then
@@ -224,14 +224,14 @@ step_103() {
elif [ ! -z $userId ] ; then
echo " [I] Password operation for $userId"
else
echoerr " [E] No user id provided"
error -e "No user id provided"
return 1
fi
exe ldappasswd -H ldapi:/// -x -D "cn=admin,$LDAP_DC" -W -S "uid=$userId,$LDAP_OU_USERS,$LDAP_DC"
}
step_105_info() { echo "Adding <USER ID> to existing group <GROUP NAME>"; }
step_105_alias() { ALIAS="user2group"; }
step_105_alias() { echo "user2group"; }
step_105() {
shift
if [ ! -z $1 ] ; then
@@ -240,11 +240,11 @@ step_105() {
elif [ ! -z $userId ] ; then
echo " [I] User operation for $userId"
else
echoerr " [E] No user id provided"
error -e "No user id provided"
return 1
fi
if [ -z $2 ] ; then
echoerr " [E] No group name provided"
error -e "No group name provided"
return 2
fi
local groupName="$2"
@@ -266,7 +266,7 @@ member:
"
step_107_info() { echo "Removing <USER ID> from existing group <GROUP NAME>"; }
step_107_alias() { ALIAS="rmusergroup"; }
step_107_alias() { echo "rmusergroup"; }
step_107() {
shift
if [ ! -z $1 ] ; then
@@ -275,11 +275,11 @@ step_107() {
elif [ ! -z $userId ] ; then
echo " [I] User operation for $userId"
else
echoerr " [E] No user id provided"
error -e "No user id provided"
return 1
fi
if [ -z $2 ] ; then
echoerr " [E] No group name provided"
error -e "No group name provided"
return 2
fi
local groupName="$2"
@@ -300,11 +300,11 @@ member: uid=\$userId,\$LDAP_OU_USERS,\$LDAP_DC
"
step_110_info() { echo "Remove group <GROUP NAME>"; }
step_110_alias() { ALIAS="rmgroup"; }
step_110_alias() { echo "rmgroup"; }
step_110() {
shift
if [ -z $1 ] ; then
echoerr " [E] No group name provided"
error -e "No group name provided"
return 1
fi
local groupName=$1
@@ -315,11 +315,11 @@ changetype: delete
"
step_112_info() { echo "Remove user <USER ID>"; }
step_112_alias() { ALIAS="rmuser"; }
step_112_alias() { echo "rmuser"; }
step_112() {
shift
if [ -z $1 ] ; then
echoerr " [E] No user id provided"
error -e "No user id provided"
return 1
fi
local userName=$1
@@ -330,7 +330,7 @@ changetype: delete
"
step_200_info() { echo "List available groups <ADDITONAL ATTRIBUTES...>"; }
step_200_alias() { ALIAS="listgroups"; }
step_200_alias() { echo "listgroups"; }
step_200() {
shift
echo " [I] Available groups:"
@@ -338,7 +338,7 @@ step_200() {
}
step_202_info() { echo "List available users <ADDITONAL ATTRIBUTES...>"; }
step_202_alias() { ALIAS="listusers"; }
step_202_alias() { echo "listusers"; }
step_202() {
shift
echo " [I] Available user:"
@@ -364,5 +364,5 @@ variable2LdifEcho() {
echo "$tempLdif"
}
VERSION_SEQREV=10
readonly sqr_minVersion=16
. /usr/local/bin/sequencer.sh