Files
teslausb/run/cifs_archive/configure-archive.sh
cimryan 2a463ba40b Move installation of the CIFS package to run/cifs_archive/configure-archive.sh
Don't need hping3 for other systems.

Keep the reconfiguration of the packages that is done specifically for making the root file system read-only in make-root-fs-readonly.sh.
2018-11-03 17:43:35 -07:00

33 lines
877 B
Bash

#!/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 cifs_version="${cifs_version:-3.0}"
local credentials_file_path="/root/.teslaCamArchiveCredentials"
/root/bin/write-archive-configs-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."
}
function install_required_packages () {
apt-get -y --force-yes install hping3
}
install_required_packages
ARCHIVE_SERVER_IP_ADDRESS="$( $INSTALL_DIR/lookup-ip-address.sh "$archiveserver" )"
configure_archive "$ARCHIVE_SERVER_IP_ADDRESS"