Check that directory exists before removal
This commit is contained in:
parent
1ec6f3c20c
commit
2f17e17316
|
@ -2998,6 +2998,7 @@ function restore_database {
|
||||||
fi
|
fi
|
||||||
echo ' if [ ${2} ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
echo ' if [ ${2} ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||||
echo ' if [ -d /var/www/${2}/htdocs ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
echo ' if [ -d /var/www/${2}/htdocs ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||||
|
echo ' if [ -d /root/temp${1}/${RESTORE_SUBDIR}/www/${2}/htdocs ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||||
echo ' rm -rf /var/www/${2}/htdocs' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
echo ' rm -rf /var/www/${2}/htdocs' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||||
echo ' mv /root/temp${1}/${RESTORE_SUBDIR}/www/${2}/htdocs /var/www/${2}/' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
echo ' mv /root/temp${1}/${RESTORE_SUBDIR}/www/${2}/htdocs /var/www/${2}/' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||||
echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||||
|
@ -3012,6 +3013,7 @@ function restore_database {
|
||||||
echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||||
echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||||
echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||||
|
echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||||
echo '}' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
echo '}' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4526,6 +4528,7 @@ function restore_database_from_friend {
|
||||||
fi
|
fi
|
||||||
echo ' if [ ${1} ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
echo ' if [ ${1} ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
||||||
echo ' if [ -d /var/www/${2}/htdocs ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
echo ' if [ -d /var/www/${2}/htdocs ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
||||||
|
echo ' if [ -d /root/temp${1}/${RESTORE_SUBDIR}/www/${2}/htdocs ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
||||||
echo ' rm -rf /var/www/${2}/htdocs' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
echo ' rm -rf /var/www/${2}/htdocs' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
||||||
echo ' mv /root/temp${1}/${RESTORE_SUBDIR}/www/${2}/htdocs /var/www/${2}/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
echo ' mv /root/temp${1}/${RESTORE_SUBDIR}/www/${2}/htdocs /var/www/${2}/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
||||||
echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
||||||
|
@ -4538,6 +4541,7 @@ function restore_database_from_friend {
|
||||||
echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
||||||
echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
||||||
echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
||||||
|
echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
||||||
echo '}' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
echo '}' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue