mirror of
https://github.com/cimryan/teslausb.git
synced 2026-03-01 04:30:33 +00:00
28 lines
753 B
Bash
28 lines
753 B
Bash
#!/bin/bash -eu
|
|
|
|
cifs_version="${cifs_version:-3}"
|
|
|
|
function configure_archive () {
|
|
local archive_server_ip_address="$1"
|
|
|
|
echo "Configuring the archive..."
|
|
|
|
local archive_path="/mnt/archive"
|
|
|
|
if [ ! -e "$archive_path" ]
|
|
then
|
|
mkdir "$archive_path"
|
|
fi
|
|
|
|
local credentials_file_path="/root/.teslaCamArchiveCredentials"
|
|
|
|
/root/bin/write_archive_credentials_to.sh "$credentials_file_path"
|
|
|
|
echo "//$archive_server_ip_address/$sharename $archive_path cifs vers=${cifs_version},credentials=${credentials_file_path},iocharset=utf8,file_mode=0777,dir_mode=0777 0" >> /etc/fstab
|
|
|
|
echo "Configured the archive."
|
|
}
|
|
|
|
ARCHIVE_SERVER_IP_ADDRESS="$( /root/bin/get-archiveserver-ip-address.sh )"
|
|
|
|
configure_archive "$ARCHIVE_SERVER_IP_ADDRESS" |