diff --git a/seqs/ejabberd.sh b/seqs/ejabberd.sh old mode 100755 new mode 100644 index 2b715fb..da39151 --- a/seqs/ejabberd.sh +++ b/seqs/ejabberd.sh @@ -37,25 +37,38 @@ step_2() { exe mv "$toolCertLoc" "${toolCertLoc}.bck" exe ln -s "$certLoc" "$toolCertLoc" - # for read access to certificate + # read access for ejabberd to read certificate exe chown root:ejabberd "$certRoot" exe chmod 750 "$certRoot" } step_3_info() { echo "Create basic configuration"; } step_3() { - readDomain - echo -e "\nThis user will be the admin:" - readUser - addConf -c "$(cat $SEQDIR/ejabberd.yml)" "$toolConfLoc" - saveReturn $? - endReturn - exe sed -i "s/mydomain\.eu/${myDomain}/" "$toolConfLoc" - exe sed -i "s/myuser/${myUser}/" "$toolConfLoc" - exe mkdir -p "$toolStorageLoc" - exe chown root:$toolName "$toolStorageLoc" + if [ ! -f $SEQDIR/ejabberd.yml ] ; then + addConf -m "$MissingConfEntry" "$toolConfLoc" + else + readDomain + echo -e "\nThis user will be the admin:" + readUser + addConf -c "$(cat $SEQDIR/ejabberd.yml)" "$toolConfLoc" + # modify configuration + exe sed -i "s/mydomain\.eu/${myDomain}/" "$toolConfLoc" + exe sed -i "s/myuser/${myUser}/" "$toolConfLoc" + # create storage for http upload + exe mkdir -p "$toolStorageLoc" + exe chown root:$toolName "$toolStorageLoc" + exe chmod 770 "$toolStorageLoc" + fi } +MissingConfEntry="\ +Seq's basic configuration file \"$SEQDIR/ejabberd.yml\" missing. +Backup $toolConfLoc and create a configuration manually. + +Some essential settings needed: +- Domain +- Admin User" + step_4_info() { echo "Restart $toolName"; } step_4_alias() { ALIAS="restart"; } step_4() {