This commit is contained in:
parent
dbcef96bc2
commit
5d42db7331
18
build.sh
18
build.sh
@ -101,17 +101,13 @@ if [ $AUTO_INSTALL = true ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
read -p "Do you want to install the program? (y/n) " -n 1 -r
|
print_status "Installing dropshell..."
|
||||||
echo
|
sudo make install
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
if [ $? -eq 0 ]; then
|
||||||
print_status "Installing dropshell..."
|
print_status "Installation successful!"
|
||||||
sudo make install
|
else
|
||||||
if [ $? -eq 0 ]; then
|
print_error "Installation failed!"
|
||||||
print_status "Installation successful!"
|
exit 1
|
||||||
else
|
|
||||||
print_error "Installation failed!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -772,8 +772,8 @@ std::string service_runner::get_latest_backup_file(const std::string& server, co
|
|||||||
bool service_runner::rsync_copy(const std::string& local_path, const std::string& remote_path, bool silent) {
|
bool service_runner::rsync_copy(const std::string& local_path, const std::string& remote_path, bool silent) {
|
||||||
std::cout << "Copying: [LOCAL] " << local_path << std::endl << std::string(8,' ')<<"[REMOTE] " << remote_path << std::endl;
|
std::cout << "Copying: [LOCAL] " << local_path << std::endl << std::string(8,' ')<<"[REMOTE] " << remote_path << std::endl;
|
||||||
|
|
||||||
runner::runner_local rsync_runner("rsync", {"--delete","--mkpath","-zrpc","-e",quote("ssh -p " + mServerEnv.get_SSH_PORT()),local_path,
|
runner::runner_local rsync_runner("rsync", {"--delete","--mkpath","-zrpc","-e",quote("ssh -p " + mServerEnv.get_SSH_PORT()),quote(local_path),
|
||||||
mServerEnv.get_SSH_USER()+"@"+mServerEnv.get_SSH_HOST()+":"+remote_path}, "", {}, true);
|
quote(mServerEnv.get_SSH_USER()+"@"+mServerEnv.get_SSH_HOST()+":"+remote_path)});
|
||||||
|
|
||||||
if (!rsync_runner.execute()) {
|
if (!rsync_runner.execute()) {
|
||||||
std::cerr << "Failed to copy files using rsync" << std::endl;
|
std::cerr << "Failed to copy files using rsync" << std::endl;
|
||||||
|
@ -112,6 +112,12 @@ bool runner_local::execute() {
|
|||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cout << "Executing command: " << mCommand << std::endl;
|
||||||
|
std::cout << "Args: ";
|
||||||
|
for (auto& arg : mArgs) std::cout << "[" << arg << "] ";
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
execvp(mCommand.c_str(), argv.data());
|
execvp(mCommand.c_str(), argv.data());
|
||||||
perror("execvp");
|
perror("execvp");
|
||||||
exit(127);
|
exit(127);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user