2024-06-26 10:34:37 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
mount -o remount,rw /
|
|
|
|
|
|
|
|
# Redirect all output to a log file
|
|
|
|
exec > /data/log/rc.local.log 2>&1
|
|
|
|
# Set root password non-interactively
|
|
|
|
echo "Setting root password..."
|
|
|
|
echo "root:salidomo" | /usr/sbin/chpasswd
|
|
|
|
|
|
|
|
# Check the exit status of chpasswd
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
echo "Root password set successfully."
|
|
|
|
else
|
|
|
|
echo "Failed to set root password."
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Remove existing timezone link (if it exists)
|
|
|
|
if [ -L /etc/localtime ]; then
|
|
|
|
echo "Removing existing timezone link..."
|
|
|
|
rm /etc/localtime
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Create a symbolic link to the desired timezone
|
|
|
|
echo "Creating symbolic link to timezone..."
|
|
|
|
ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
|
|
|
|
|
|
|
|
# Source directory
|
|
|
|
source_dir="/data/dbus-fzsonick-48tl"
|
|
|
|
|
|
|
|
# Destination directory
|
|
|
|
destination_dir_upper="/opt/victronenergy/"
|
|
|
|
destination_dir="/opt/victronenergy/dbus-fzsonick-48tl/"
|
|
|
|
|
|
|
|
# Check if the destination directory exists
|
|
|
|
if [ -d "$destination_dir" ]; then
|
|
|
|
# Remove the destination directory
|
|
|
|
rm -r "$destination_dir"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Copy the contents of the source directory to the destination directory
|
|
|
|
echo "Copying battery folder from /data to /opt/victronenergy/ ..."
|
|
|
|
cp -r "$source_dir" "$destination_dir_upper"
|
|
|
|
|
|
|
|
# Set MPPT network mode to 0
|
|
|
|
echo "Changing MPPT network mode to 0..."
|
|
|
|
sed -i "s|('/Link/NetworkMode', [^)]*)|('/Link/NetworkMode', 0)|g" /opt/victronenergy/dbus-systemcalc-py/delegates/dvcc.py
|
|
|
|
|
2024-07-26 12:30:29 +00:00
|
|
|
# Set aggregator service symlink
|
|
|
|
echo "Creating symbolic link to aggregator service..."
|
|
|
|
aggregator_service_path="/data/aggregator"
|
|
|
|
# aggregator_symlink_path="/opt/victronenergy/service"
|
|
|
|
aggregator_symlink_path="/service"
|
|
|
|
ln -s "$aggregator_service_path" "$aggregator_symlink_path"
|
|
|
|
|
|
|
|
# Set VPN service symlink
|
|
|
|
echo "Creating symbolic link to VPN service..."
|
2024-07-29 14:06:20 +00:00
|
|
|
find /data/innovenergy/openvpn -type f -exec chmod 777 {} \;
|
2024-07-26 12:30:29 +00:00
|
|
|
vpn_service_path="/data/innovenergy/openvpn/service"
|
|
|
|
# vpn_symlink_path="/opt/victronenergy/service/openvpn"
|
|
|
|
vpn_symlink_path="/service/openvpn"
|
|
|
|
ln -s "$vpn_service_path" "$vpn_symlink_path"
|
|
|
|
|
2024-12-16 17:15:01 +00:00
|
|
|
# # Set EmuMeter service symlink
|
|
|
|
# echo "Creating symbolic link to EmuMeter service..."
|
|
|
|
# EmuMeter_service_path="/data/EmuMeter/service"
|
|
|
|
# EmuMeter_symlink_path="/service/EmuMeter"
|
|
|
|
# ln -s "$EmuMeter_service_path" "$EmuMeter_symlink_path"
|
|
|
|
|
2024-06-26 10:34:37 +00:00
|
|
|
|
|
|
|
exit 0
|