Separate files into those used for setup and those used at runtime.

Files used for both will go in the run tree.
This commit is contained in:
cimryan
2018-10-24 20:55:29 -07:00
parent ef10b2ec67
commit e875763e58
27 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
#!/bin/bash -eu
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"