Skip to content

Commit ac2580d

Browse files
committed
connection test, corrections
1 parent ea115b8 commit ac2580d

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

install.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,17 @@ read -p "Domaine pour UserPrincipalName : " DOMAIN
3737
echo "Génération du fichier de configuration"
3838
CONFFILE=${INSTALL}/etc/config.conf
3939
echo "host=${HOST}" > ${CONFFILE}
40-
echo "user=${DN}" >> ${CONFFILE}
40+
echo "user=${USER}" >> ${CONFFILE}
4141
echo "password=${PASSWORD}" >> ${CONFFILE}
4242
echo "base=${BASE}" >> ${CONFFILE}
4343
echo "domain=${DOMAIN}" >> ${CONFFILE}
4444
echo "backendFor=adm,etd,esn" >> ${CONFFILE}
4545
chmod 600 ${CONFFILE}
4646
echo "Generation d'une clé ssh"
47-
mkdir $INSTALL/.ssh
48-
ssh-keygen -t ed25519 -f ${INSTALL}/.ssh/id_ed25519 -N ''
47+
if [ ! -f $INSTALL/.ssh/id_ed25519 ];then
48+
mkdir $INSTALL/.ssh 2>/dev/null
49+
ssh-keygen -t ed25519 -f ${INSTALL}/.ssh/id_ed25519 -N ''
50+
fi
4951
./copy_ssh_key.py --server=${HOST} --user=${USER} --password="${PASSWORD}" --keyfile=${INSTALL}/.ssh/id_ed25519.pub
5052
OK=$?
5153
if [ $OK -ne 0 ];then

src/bin/changepwd.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/python3 -u
12
import sys
23
sys.path.append('../lib')
34
import ad_utils as ad

src/bin/ping.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/python3 -u
12
import sys
23
sys.path.append('../lib')
34
import ad_utils as ad
@@ -6,4 +7,4 @@
67
config=u.read_config('../etc/config.conf')
78
ad.set_config(config)
89
## test connection
9-
ad.test_conn()
10+
ad.test_conn(cat )

src/bin/resetpwd.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/python3 -u
12
import sys
23
sys.path.append('../lib')
34
import ad_utils as ad

src/bin/upsertidentity.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/python3 -u
12
import sys
23
sys.path.append('../lib')
34
import ad_utils as ad

src/ps1_templates/upsertidentity.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ try{
1212
}
1313
$UserExists = $true
1414
}
15-
catch [Microsoft.ActiveDirectory.Management.ADIdentityResolutionException] {
15+
catch{
1616
$UserExists = $false
1717
}
1818
if ($UserExists -eq $false){

0 commit comments

Comments
 (0)