From aa2248cf32fe2376001bd9a0bacfaefb0483a1e2 Mon Sep 17 00:00:00 2001 From: Yinyin Liu Date: Fri, 21 Nov 2025 06:51:32 +0100 Subject: [PATCH] added rc.local tailored to Cerbo with Biwatt batteries --- firmware/Cerbo_with_Biwatt/rc.local | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 firmware/Cerbo_with_Biwatt/rc.local diff --git a/firmware/Cerbo_with_Biwatt/rc.local b/firmware/Cerbo_with_Biwatt/rc.local new file mode 100755 index 000000000..9f8368cd9 --- /dev/null +++ b/firmware/Cerbo_with_Biwatt/rc.local @@ -0,0 +1,40 @@ +#!/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 + +# Set VPN service symlink +echo "Creating symbolic link to VPN service..." +find /data/innovenergy/openvpn -type f -exec chmod 777 {} \; +vpn_service_path="/data/innovenergy/openvpn/service" +vpn_symlink_path="/service/openvpn" +ln -s "$vpn_service_path" "$vpn_symlink_path" + +# # 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" + +exit 0