| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 | #!/bin/shecho -e '  _   _     _             _                ___ _    _         _ | | | |_ _| |__  __ _ __| |___  _ _ __   / __| |  (_)___ _ _| |_ | |_| |  _|  _ \/ _` / _| / / || |  _ \ | (__| |__| / -_)   \  _|  \___/|_| |_.__/\__,_\__|_\_\\_,_| .__/  \___|____|_\___|_||_\__|                                  |_|'if [ "$EUID" -ne 0 ]; then  echo "Please run as root"  exitfi# get the current position_cwd="$(pwd)"# check for assets forlder_assets="$_cwd/assets"if [ ! -d "$_assets" ]; then  _assets="$_cwd/../assets"  if [ ! -d "$_assets" ]; then    echo "!! can't find assets directory !!"    exit  fifi# install urbackup client# https://www.urbackup.org/client_debian_ubuntu_install.html# https://blog.stephane-huc.net/systeme/debian/urbackup_client_gui# https://urbackup.atlassian.net/wiki/spaces/US/pages/9142274/Headless+Linux+client+setup# Install the dependencies UrBackup needs# apt install build-essential "g++" "libcrypto++-dev" libz-dev -yapk add linux-headers "g++" zlib zlib-dev "crypto++@testing" "crypto++-dev@testing" makeln -s /usr/lib/libcryptopp.so /usr/lib/libcryptopp.so.5.6# Download the UrBackup client source files and extract themwget -P /tmp/ https://hndl.urbackup.org/Client/latest/urbackup-client-2.3.4.0.tar.gzcd /tmptar xzf /tmp/urbackup-client-2.3.4.0.tar.gz# Build the UrBackup client and install itcd /tmp/urbackup-client-2.3.4.0./configure --enable-headlessmake -j4make install# Make sure that the UrBackup client backend runs correctly# urbackupclientbackend -v info# configureecho -n "Please provide the urbackup-server's ip : "read _ipecho -n "Please provide the internet_authkey of server : "read _authkeyecho -n "Please provide the computer name of this client : "read _computernameecho "internet_server=$_ipinternet_server_port=55415internet_authkey=$_authkeyinternet_mode_enabled=trueinternet_image_backups_def=falsedefault_dirs_def=/etc;var/www;/var/backups/mysqlstartup_backup_delay_def=3computername=$_computername" > /usr/local/var/urbackup/data/settings.cfg# firewallufw allow from "$_ip" to any port 35621ufw allow from "$_ip" to any port 35622ufw allow from "$_ip" to any port 35623# install and enable openrc servicecp "$_assets"/urbackup.service /etc/init.d/urbackupchmod a+x /etc/init.d/urbackuprc-update add urbackupservice urbackup startcd "$_cwd"
 |