Skip to content
Snippets Groups Projects
Commit 46f97cbd authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

fix multiple use of same instance

parent cd857002
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,6 @@ done
66-all up
sleep 03
## Try consolekit
if 66-which -q ck-launch-session; then
......
......@@ -9,4 +9,4 @@ for i in ${list[@]};do
done
66-all up
sleep 03
......@@ -56,6 +56,7 @@ mod="${mod%%@*}"
mod="${mod%%@*}@"
insta="${target[0]}"
insta="${insta##*@}"
service="${mod}${insta}"
if [[ ! -d ${module_system}/${mod} ]]; then
die "fatal: module ${mod} doesn't exist"
......@@ -75,34 +76,34 @@ if [[ -z "${insta}" ]];then
die "fatal: instance for ${mod} is not set"
fi
if [[ -d ${service_system}/${mod} ]]; then
if [[ -d ${service_system}/${service} ]]; then
if (( !$force )) ; then
die "fatal: ${service_system}/${mod} already exist"
die "fatal: ${service_system}/${service} already exist"
else
rm -rf ${service_system}/${mod} || die "fatal: unable to remove ${service_system}/${mod}"
rm -rf ${service_system}/${service} || die "fatal: unable to remove ${service_system}/${service}"
fi
fi
cp -rT ${module_system}/${mod} ${service_system}/${mod} || die "fatal: unable to cp ${module_system}/${mod} to ${service_system}/${mod}"
cp -rT ${module_system}/${mod} ${service_system}/${service} || die "fatal: unable to cp ${module_system}/${mod} to ${service_system}/${service}"
## @I in file
for i in $(find ${service_system}/${mod} -mindepth 1 -type f);do
for i in $(find ${service_system}/${service} -mindepth 1 -type f);do
sed -i "s:@I:${insta}:g" $i || die "fatal: unable to sed ${i}"
done
## change directory name
for i in $(find ${service_system}/${mod} -mindepth 1 -type d|grep -v "configure");do
for i in $(find ${service_system}/${service} -mindepth 1 -type d|grep -v "configure");do
mv $i $(66-echo -- ${i}|sed "s:@M:${insta}:g") || die "fatal: unable to move ${i} to $(echo ${i}|sed "s:@M:${insta}:g")"
done
## change file name
for i in $(find ${service_system}/${mod} -mindepth 1 -type f|grep -v "configure");do
for i in $(find ${service_system}/${service} -mindepth 1 -type f|grep -v "configure");do
mv $i $(66-echo -- ${i}|sed "s:@M:${insta}:g") || die "fatal: unable to move ${i} to $(echo ${i}|sed "s:@M:${insta}:g")"
done
## run .configure scripts
if [[ -x ${service_system}/${mod}/.configure/configure ]]; then
cd ${service_system}/${mod}/.configure/
${service_system}/${mod}/.configure/configure ${insta} || die "fatal: unable to configure ${service_system}/${mod}"
rm -rf ${service_system}/${mod}/.configure || die "fatal: unable to remove ${service_system}/${mod}/.configure"
if [[ -x ${service_system}/${service}/.configure/configure ]]; then
cd ${service_system}/${service}/.configure/
${service_system}/${service}/.configure/configure ${insta} || die "fatal: unable to configure ${service_system}/${service}"
rm -rf ${service_system}/${service}/.configure || die "fatal: unable to remove ${service_system}/${service}/.configure"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment