feat: move config to .env
fix: nfs/cifs dependencies
This commit is contained in:
+10
-43
@@ -1,50 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
# "smb" or "nfs"
|
||||
STORAGE_TYPE="nfs"
|
||||
DIR=$(cd "$(dirname "$0")" && pwd)
|
||||
ENV_FILE="$DIR/.env"
|
||||
|
||||
# ip or hostname
|
||||
S_HOST="nfs.lan"
|
||||
|
||||
# /path/to/backup
|
||||
S_PATH="/mnt/media1/backup"
|
||||
|
||||
SMB_USER="guest"
|
||||
SMB_PASS="guest"
|
||||
|
||||
LOCAL_KEEP=10
|
||||
HOST_KEEP=30
|
||||
if [ -f "$ENV_FILE" ]; then
|
||||
. "$ENV_FILE"
|
||||
else
|
||||
echo " [!] Error: .env file not found at $ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
HNAME=$(uci get system.@system[0].hostname)
|
||||
DATE=$(date +%Y-%m-%d_%H-%M)
|
||||
|
||||
S_MOUNT="/tmp/share"
|
||||
|
||||
C_LIST="
|
||||
/etc/config
|
||||
/etc/xray
|
||||
/etc/unbound
|
||||
/root/.ssh
|
||||
/opt/.xray-config
|
||||
/opt/.backup-manager
|
||||
/etc/nftables.d/10-netmap.nft
|
||||
/etc/nftables.d/15-pbr-mark.nft
|
||||
/etc/hotplug.d/iface/99-xray-restart
|
||||
/etc/zabbix_agentd.conf
|
||||
/etc/dropbear
|
||||
/etc/banner
|
||||
/etc/init.d/xray
|
||||
/etc/crontabs/root
|
||||
"
|
||||
|
||||
C_EXCLUDE="
|
||||
/opt/.backup-manager/local_backups
|
||||
"
|
||||
|
||||
H_REPLACE="wpad dnsmasq"
|
||||
|
||||
DIR=$(cd "$(dirname "$0")" && pwd)
|
||||
#DIR="/opt/.backup-manager"
|
||||
L_BACKUP_DIR="$DIR/local_backups"
|
||||
SCR_BACKUP="$DIR/backup-configs.sh"
|
||||
SCR_APK="$DIR/backup-apk.sh"
|
||||
@@ -71,8 +38,8 @@ check_network() {
|
||||
check_dependencies() {
|
||||
printf "Checking %s dependencies... " "$STORAGE_TYPE"
|
||||
local pkgs=""
|
||||
[ "$STORAGE_TYPE" = "nfs" ] && pkgs="nfs-utils"
|
||||
[ "$STORAGE_TYPE" = "smb" ] && pkgs="cifsmount"
|
||||
[ "$STORAGE_TYPE" = "nfs" ] && pkgs="nfs-utils kmod-fs-nfs kmod-fs-nfs-v3 kmod-fs-nfs-v4"
|
||||
[ "$STORAGE_TYPE" = "cifs" ] && pkgs="cifsmount kmod-fs-cifs"
|
||||
|
||||
local missing=""
|
||||
for pkg in $pkgs; do
|
||||
|
||||
Reference in New Issue
Block a user