From 374d4a1c98c93dfe0105bd50021922208b8045f2 Mon Sep 17 00:00:00 2001 From: 2Shirt <1923621+2Shirt@users.noreply.github.com> Date: Thu, 21 Dec 2017 23:17:45 -0700 Subject: [PATCH] Removed old mount-backup-shares script --- .bin/Scripts/linux-old/mount-backup-shares | 67 ---------------------- 1 file changed, 67 deletions(-) delete mode 100755 .bin/Scripts/linux-old/mount-backup-shares diff --git a/.bin/Scripts/linux-old/mount-backup-shares b/.bin/Scripts/linux-old/mount-backup-shares deleted file mode 100755 index 1a9085b9..00000000 --- a/.bin/Scripts/linux-old/mount-backup-shares +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -## Wizard Kit: Backup share mount tool - -die () { - echo "$0:" "$@" >&2 - exit 1 -} - -# Load settings -if [[ -f "/run/archiso/bootmnt/arch/main.conf" ]]; then - source "/run/archiso/bootmnt/arch/main.conf" || \ - die "ERROR: failed to load main.conf (from /run/archiso/bootmnt/arch/)" -else - source "/usr/local/bin/main.conf" || \ - die "ERROR: failed to load main.conf (from /usr/local/bin/)" -fi - -# Connect to a network -connect-to-network - -# Mount loop -echo "Mounting NAS backup shares" -for x in {1..4}; do - _skip="False" - - # Load Backup share info - eval "declare -a _backup=(\${BACKUP_$x[@]})" - _name="${_backup[0]}" - _ip="${_backup[1]}" - _share="${_backup[2]}" - _user="${_backup[3]}" - _pass="${_backup[4]}" - - # Check backup share info - if echo "$_name" | grep -Eq '^\s*$'; then - _skip="True"; - fi - if echo "$_ip" | grep -Eq '^\s*$'; then - _skip="True"; - fi - if echo "$_share" | grep -Eq '^\s*$'; then - _skip="True"; - fi - if echo "$_user" | grep -Eq '^\s*$'; then - _skip="True"; - fi - if echo "$_pass" | grep -Eq '^\s*$'; then - _skip="True"; - fi - - # Mount - if [[ "$_skip" == "False" ]]; then - sudo mkdir "/Backups/$_name" -p - if mountpoint -q "/Backups/$_name"; then - echo "$_name: (Already) mounted at /Backups/$_name ($(df -h "/Backups/$_name" | tail -1 | awk '{print $4}' | sed -r 's/([KMGT])/ \1b/') free)" - else - if sudo mount "//$_ip/$_share" "/Backups/$_name" -o username=$_user,password=$_pass 2>/dev/null; then - echo "$_name: Mounted at /Backups/$_name ($(df -h "/Backups/$_name" | tail -1 | awk '{print $4}' | sed -r 's/([KMGT])/ \1b/') free)" - else - rmdir "/Backups/$_name" -p 2>/dev/null - echo "$_name: Failed to mount" - fi - fi - fi -done -