Check and migrate old configuration
This commit is contained in:
parent
e1f657c6be
commit
3c11961951
35
src/ks-upa
35
src/ks-upa
|
@ -14,7 +14,7 @@ dirTemp="/tmp"
|
|||
listCompTemp="ks-tools.list-full"
|
||||
listCompTempTest="ks-tools.list-full.test"
|
||||
listTemp="ks-tools.list"
|
||||
dirConfig="$HOME/.ks-tools"
|
||||
dirConfig="${HOME}/.ks-tools"
|
||||
ksToolsTempFolder="/tmp/ks-tools"
|
||||
|
||||
# Check cygwin alias (for Windows)
|
||||
|
@ -438,6 +438,39 @@ function checkDependencies() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Function to migrate old configuration.
|
||||
if [ -f ${dirConfig}/USER ] ; then
|
||||
cat ${dirConfig}/USER > ${dirConfig}/ks-upload-user
|
||||
echo "* Migrating ${dirConfig}/USER > ${dirConfig}/ks-upload-user"
|
||||
rm -rf ${dirConfig}/USER
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/PASS ] ; then
|
||||
echo "* Migrating ${dirConfig}/PASS > ${dirConfig}/ks-upload-pass"
|
||||
current_pass=$(cat ${dirConfig}/PASS)
|
||||
encrypt_kstools "${current_pass}" > ${dirConfig}/ks-upload-pass
|
||||
rm -rf ${dirConfig}/PASS
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/SERVER ] ; then
|
||||
cat ${dirConfig}/SERVER > ${dirConfig}/ks-upload-server
|
||||
echo "* Migrating ${dirConfig}/SERVER > ${dirConfig}/ks-upload-server"
|
||||
rm -rf ${dirConfig}/SERVER
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/DIR_SERVER ] ; then
|
||||
cat ${dirConfig}/DIR_SERVER > ${dirConfig}/ks-upload-dirserver
|
||||
echo "* Migrating ${dirConfig}/DIR_SERVER > ${dirConfig}/ks-upload-dirserver"
|
||||
rm -rf ${dirConfig}/DIR_SERVER
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/DIR ] ; then
|
||||
cat ${dirConfig}/DIR > ${dirConfig}/ks-upload-dirlocal
|
||||
echo "* Migrating ${dirConfig}/DIR > ${dirConfig}/ks-upload-dirlocal"
|
||||
rm -rf ${dirConfig}/DIR
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
# Check if the configuration directory exists.
|
||||
if [ -d ${dirConfig} ] ; then
|
||||
echo ${dirConfig} > /dev/null
|
||||
|
|
35
src/ks-upf
35
src/ks-upf
|
@ -14,7 +14,7 @@ dirTemp="/tmp"
|
|||
listCompTemp="ks-tools.list-full"
|
||||
listCompTempTest="ks-tools.list-full.test"
|
||||
listTemp="ks-tools.list"
|
||||
dirConfig="$HOME/.ks-tools"
|
||||
dirConfig="${HOME}/.ks-tools"
|
||||
ksToolsTempFolder="/tmp/ks-tools"
|
||||
|
||||
# Check cygwin alias (for Windows)
|
||||
|
@ -456,6 +456,39 @@ function checkDependencies() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Function to migrate old configuration.
|
||||
if [ -f ${dirConfig}/USER ] ; then
|
||||
cat ${dirConfig}/USER > ${dirConfig}/ks-upload-user
|
||||
echo "* Migrating ${dirConfig}/USER > ${dirConfig}/ks-upload-user"
|
||||
rm -rf ${dirConfig}/USER
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/PASS ] ; then
|
||||
echo "* Migrating ${dirConfig}/PASS > ${dirConfig}/ks-upload-pass"
|
||||
current_pass=$(cat ${dirConfig}/PASS)
|
||||
encrypt_kstools "${current_pass}" > ${dirConfig}/ks-upload-pass
|
||||
rm -rf ${dirConfig}/PASS
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/SERVER ] ; then
|
||||
cat ${dirConfig}/SERVER > ${dirConfig}/ks-upload-server
|
||||
echo "* Migrating ${dirConfig}/SERVER > ${dirConfig}/ks-upload-server"
|
||||
rm -rf ${dirConfig}/SERVER
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/DIR_SERVER ] ; then
|
||||
cat ${dirConfig}/DIR_SERVER > ${dirConfig}/ks-upload-dirserver
|
||||
echo "* Migrating ${dirConfig}/DIR_SERVER > ${dirConfig}/ks-upload-dirserver"
|
||||
rm -rf ${dirConfig}/DIR_SERVER
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/DIR ] ; then
|
||||
cat ${dirConfig}/DIR > ${dirConfig}/ks-upload-dirlocal
|
||||
echo "* Migrating ${dirConfig}/DIR > ${dirConfig}/ks-upload-dirlocal"
|
||||
rm -rf ${dirConfig}/DIR
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
# Check if the configuration directory exists.
|
||||
if [ -d ${dirConfig} ] ; then
|
||||
echo ${dirConfig} > /dev/null
|
||||
|
|
35
src/ks-upr
35
src/ks-upr
|
@ -14,7 +14,7 @@ dirTemp="/tmp"
|
|||
listCompTemp="ks-tools.list-full"
|
||||
listCompTempTest="ks-tools.list-full.test"
|
||||
listTemp="ks-tools.list"
|
||||
dirConfig="$HOME/.ks-tools"
|
||||
dirConfig="${HOME}/.ks-tools"
|
||||
ksToolsTempFolder="/tmp/ks-tools"
|
||||
|
||||
# Check cygwin alias (for Windows)
|
||||
|
@ -398,6 +398,39 @@ function checkDependencies() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Function to migrate old configuration.
|
||||
if [ -f ${dirConfig}/USER ] ; then
|
||||
cat ${dirConfig}/USER > ${dirConfig}/ks-upload-user
|
||||
echo "* Migrating ${dirConfig}/USER > ${dirConfig}/ks-upload-user"
|
||||
rm -rf ${dirConfig}/USER
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/PASS ] ; then
|
||||
echo "* Migrating ${dirConfig}/PASS > ${dirConfig}/ks-upload-pass"
|
||||
current_pass=$(cat ${dirConfig}/PASS)
|
||||
encrypt_kstools "${current_pass}" > ${dirConfig}/ks-upload-pass
|
||||
rm -rf ${dirConfig}/PASS
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/SERVER ] ; then
|
||||
cat ${dirConfig}/SERVER > ${dirConfig}/ks-upload-server
|
||||
echo "* Migrating ${dirConfig}/SERVER > ${dirConfig}/ks-upload-server"
|
||||
rm -rf ${dirConfig}/SERVER
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/DIR_SERVER ] ; then
|
||||
cat ${dirConfig}/DIR_SERVER > ${dirConfig}/ks-upload-dirserver
|
||||
echo "* Migrating ${dirConfig}/DIR_SERVER > ${dirConfig}/ks-upload-dirserver"
|
||||
rm -rf ${dirConfig}/DIR_SERVER
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/DIR ] ; then
|
||||
cat ${dirConfig}/DIR > ${dirConfig}/ks-upload-dirlocal
|
||||
echo "* Migrating ${dirConfig}/DIR > ${dirConfig}/ks-upload-dirlocal"
|
||||
rm -rf ${dirConfig}/DIR
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
# Check if the configuration directory exists.
|
||||
if [ -d ${dirConfig} ] ; then
|
||||
echo ${dirConfig} > /dev/null
|
||||
|
|
33
src/ks-upv
33
src/ks-upv
|
@ -439,6 +439,39 @@ function checkDependencies() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Function to migrate old configuration.
|
||||
if [ -f ${dirConfig}/USER ] ; then
|
||||
cat ${dirConfig}/USER > ${dirConfig}/ks-upload-user
|
||||
echo "* Migrating ${dirConfig}/USER > ${dirConfig}/ks-upload-user"
|
||||
rm -rf ${dirConfig}/USER
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/PASS ] ; then
|
||||
echo "* Migrating ${dirConfig}/PASS > ${dirConfig}/ks-upload-pass"
|
||||
current_pass=$(cat ${dirConfig}/PASS)
|
||||
encrypt_kstools "${current_pass}" > ${dirConfig}/ks-upload-pass
|
||||
rm -rf ${dirConfig}/PASS
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/SERVER ] ; then
|
||||
cat ${dirConfig}/SERVER > ${dirConfig}/ks-upload-server
|
||||
echo "* Migrating ${dirConfig}/SERVER > ${dirConfig}/ks-upload-server"
|
||||
rm -rf ${dirConfig}/SERVER
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/DIR_SERVER ] ; then
|
||||
cat ${dirConfig}/DIR_SERVER > ${dirConfig}/ks-upload-dirserver
|
||||
echo "* Migrating ${dirConfig}/DIR_SERVER > ${dirConfig}/ks-upload-dirserver"
|
||||
rm -rf ${dirConfig}/DIR_SERVER
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f ${dirConfig}/DIR ] ; then
|
||||
cat ${dirConfig}/DIR > ${dirConfig}/ks-upload-dirlocal
|
||||
echo "* Migrating ${dirConfig}/DIR > ${dirConfig}/ks-upload-dirlocal"
|
||||
rm -rf ${dirConfig}/DIR
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
# Check if the configuration directory exists.
|
||||
if [ -d ${dirConfig} ] ; then
|
||||
echo ${dirConfig} > /dev/null
|
||||
|
|
Loading…
Reference in New Issue
Block a user