mirror of
https://github.com/kneutron/ansitest.git
synced 2025-01-30 05:02:54 +08:00
33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
# bash - this is defining where backup tars, etc will be stored - can be local, sshfs, CIFS, NFS but must be R/W
|
|
# can be overridden b4 sourcing
|
|
|
|
# NOTE this script should be in /root/bin/boojum and be chmod +x
|
|
# it is sourced / used by several backup scripts
|
|
# you can have it elsewhere (like /root) for convenience and soft-symlink to it if needed
|
|
# but the scripts are checking for it in /root/bin/boojum
|
|
|
|
# xxx TODO EDITME
|
|
#[ "$bkpdest" = "" ] && export bkpdest=/mnt/imac5
|
|
[ "$bkpdest" = "" ] && export bkpdest=/mnt/seatera4-xfs
|
|
|
|
[ `echo $bkpdest |grep -c "/mnt/"` -gt 0 ] && mount $bkpdest # mount if not ZFS!
|
|
[ `echo $bkpdest |grep -c "/media/"` -gt 0 ] && mount $bkpdest # mount if not ZFS!
|
|
|
|
# from failexit.mrg
|
|
function failexit () {
|
|
echo '! Something failed! Code: '"$1 $2" # code # (and optional description)
|
|
exit $1
|
|
}
|
|
|
|
|
|
[ -e "$bkpdest/NOTHERE" ] && failexit 99 "$bkpdest NOTHERE -- NOT MOUNTED"
|
|
# "If" checking for NOTHERE file...
|
|
|
|
chkmount=`df |grep -c $bkpdest`
|
|
[ $chkmount -gt 0 ] || failexit 99 "$bkpdest NOT MOUNTED"
|
|
|
|
# NOTE code 199 is generally could not cd to dir
|
|
|
|
|
|
export myhn=$(hostname)
|