mirror of
https://github.com/cimryan/teslausb.git
synced 2026-02-28 20:20:32 +00:00
Merge pull request #91 from rtanaka/master
adding back write-archive script
This commit is contained in:
@@ -15,8 +15,7 @@ function configure_archive () {
|
||||
local cifs_version="${cifs_version:-3.0}"
|
||||
|
||||
local credentials_file_path="/root/.teslaCamArchiveCredentials"
|
||||
echo "username=$shareuser" > "$credentials_file_path"
|
||||
echo "password=$sharepassword" >> "$credentials_file_path"
|
||||
/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
|
||||
|
||||
|
||||
@@ -26,9 +26,8 @@ function check_archive_mountable () {
|
||||
|
||||
local cifs_version="${cifs_version:-3.0}"
|
||||
|
||||
local tmp_credentials_file_path="/tmp/.teslaCamArchiveCredentials"
|
||||
echo "username=$shareuser" > "$tmp_credentials_file_path"
|
||||
echo "password=$sharepassword" >> "$tmp_credentials_file_path"
|
||||
local tmp_credentials_file_path="/tmp/teslaCamArchiveCredentials"
|
||||
/root/bin/write-archive-configs-to.sh "$tmp_credentials_file_path"
|
||||
|
||||
local mount_failed=false
|
||||
mount -t cifs "//$archive_server_ip_address/$sharename" "$test_mount_location" -o "vers=${cifs_version},credentials=${tmp_credentials_file_path},iocharset=utf8,file_mode=0777,dir_mode=0777" || mount_failed=true
|
||||
|
||||
6
run/cifs_archive/write-archive-configs-to.sh
Normal file
6
run/cifs_archive/write-archive-configs-to.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash -eu
|
||||
|
||||
FILE_PATH="$1"
|
||||
|
||||
echo "username=$shareuser" > "$FILE_PATH"
|
||||
echo "password=$sharepassword" >> "$FILE_PATH"
|
||||
@@ -3,8 +3,8 @@
|
||||
function configure_archive () {
|
||||
echo "Configuring rclone archive..."
|
||||
|
||||
echo "drive=$RCLONE_DRIVE" > /root/.teslaCamRcloneConfig
|
||||
echo "path=$RCLONE_PATH" >> /root/.teslaCamRcloneConfig
|
||||
local config_file_path="/root/.teslaCamRcloneConfig"
|
||||
/root/bin/write-archive-configs-to.sh "$config_file_path"
|
||||
|
||||
if [ ! -L "/root/.config/rclone" ] && [ -e "/root/.config/rclone" ]
|
||||
then
|
||||
|
||||
6
run/rclone_archive/write-archive-configs-to.sh
Normal file
6
run/rclone_archive/write-archive-configs-to.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash -eu
|
||||
|
||||
FILE_PATH="$1"
|
||||
|
||||
echo "drive=$RCLONE_DRIVE" > "$FILE_PATH"
|
||||
echo "path=$RCLONE_PATH" >> "$FILE_PATH"
|
||||
@@ -3,9 +3,8 @@
|
||||
function configure_archive () {
|
||||
echo "Configuring the rsync archive..."
|
||||
|
||||
echo "user=$RSYNC_USER" > /root/.teslaCamRsyncConfig
|
||||
echo "server=$RSYNC_SERVER" >> /root/.teslaCamRsyncConfig
|
||||
echo "path=$RSYNC_PATH" >> /root/.teslaCamRsyncConfig
|
||||
local config_file_path="/root/.teslaCamRsyncConfig"
|
||||
/root/bin/write-archive-configs-to.sh "$config_file_path"
|
||||
}
|
||||
|
||||
configure_archive
|
||||
7
run/rsync_archive/write-archive-configs-to.sh
Normal file
7
run/rsync_archive/write-archive-configs-to.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash -eu
|
||||
|
||||
FILE_PATH="$1"
|
||||
|
||||
echo "user=$RSYNC_USER" > "$FILE_PATH"
|
||||
echo "server=$RSYNC_SERVER" >> "$FILE_PATH"
|
||||
echo "path=$RSYNC_PATH" >> "$FILE_PATH"
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
REPO=${REPO:-cimryan}
|
||||
BRANCH=${BRANCH:-master}
|
||||
INSTALL_DIR=${INSTALL_DIR:-/root/bin}
|
||||
|
||||
export INSTALL_DIR=${INSTALL_DIR:-/root/bin}
|
||||
|
||||
function check_variable () {
|
||||
local var_name="$1"
|
||||
@@ -115,13 +115,13 @@ function install_archive_scripts () {
|
||||
get_script $install_path remountfs_rw run
|
||||
get_script $install_path lookup-ip-address.sh run
|
||||
|
||||
echo "Installing archive module scripts ($archive_module)"
|
||||
|
||||
echo "Installing archive module scripts"
|
||||
get_script $install_path verify-archive-configuration.sh $archive_module
|
||||
get_script $install_path configure-archive.sh $archive_module
|
||||
get_script $install_path archive-clips.sh $archive_module
|
||||
get_script $install_path connect-archive.sh $archive_module
|
||||
get_script $install_path disconnect-archive.sh $archive_module
|
||||
get_script $install_path write-archive-configs-to.sh $archive_module
|
||||
}
|
||||
|
||||
function check_and_configure_pushover () {
|
||||
|
||||
Reference in New Issue
Block a user