Updates scripts

This commit is contained in:
WickedYoda committed 2025-01-29 19:31:40 -06:00
1 parent f9b668626b
commit 5185ad0c51
8 files changed
+162

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
+6
View File
@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
</project>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/public-setupfiles.iml" filepath="$PROJECT_DIR$/.idea/public-setupfiles.iml" />
</modules>
</component>
</project>
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.9" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="PLAIN" />
<option name="myDocStringFormat" value="Plain" />
</component>
</module>
Generated
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
+42
View File
@@ -0,0 +1,42 @@
#!/bin/sh
# Ensure the script is run as root
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root. Use sudo or run as root."
exit 1
fi
echo "Starting full OpenWRT upgrade using opkg..."
# Step 1: Update package lists
echo "Updating package lists..."
opkg update
# Step 2: List upgradable packages
echo "Listing upgradable packages..."
opkg list-upgradable
# Step 3: Upgrade all installed packages
echo "Upgrading installed packages..."
opkg list-upgradable | cut -f1 -d ' ' | xargs -r opkg upgrade
# Step 4: Remove unnecessary packages
echo "Removing unnecessary packages..."
opkg remove --autoremove
# Step 5: Clean package cache
echo "Cleaning up package cache..."
opkg clean
# Step 6: Restart the device (optional)
echo "Upgrade complete. A reboot is recommended."
read -p "Do you want to reboot now? (y/N): " REBOOT
if [ "$REBOOT" = "y" ] || [ "$REBOOT" = "Y" ]; then
echo "Rebooting..."
reboot
else
echo "Reboot skipped. You may need to restart manually."
fi
echo "OpenWRT full upgrade completed!"
+76
View File
@@ -0,0 +1,76 @@
#!/bin/sh
# Ensure the script is run as root
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root. Use sudo or run as root."
exit 1
fi
echo "Starting SNMPv2 configuration on OpenWRT..."
# Install SNMP if not installed
opkg update
opkg install snmpd
# Define SNMP configuration file location
SNMP_CONFIG="/etc/config/snmpd"
# Backup existing SNMP configuration
if [ -f "$SNMP_CONFIG" ]; then
echo "Backing up existing SNMP configuration..."
cp "$SNMP_CONFIG" "$SNMP_CONFIG.bak"
fi
# Create SNMPv2 configuration with public community
echo "Configuring SNMPv2 with public community..."
cat <<EOL > "$SNMP_CONFIG"
config system
option enable '1'
config agent
option agentaddress 'udp:161'
config com2sec
option secname 'public'
option source 'default'
option community 'public'
config group
option groupname 'publicGroup'
option securitymodel 'v2c'
option secname 'public'
config view
option viewname 'all'
option type 'included'
option oid '.1'
config access
option groupname 'publicGroup'
option securitymodel 'v2c'
option context 'none'
option level 'noAuthNoPriv'
option prefix 'exact'
option read 'all'
option write 'none'
option notify 'none'
EOL
# Restart the SNMP service to apply changes
echo "Restarting SNMP service..."
/etc/init.d/snmpd restart
# Verify if SNMP is running
if pgrep snmpd > /dev/null; then
echo "SNMP service is running."
else
echo "Failed to start SNMP service."
exit 1
fi
# Test SNMPv2 configuration
echo "Testing SNMPv2 configuration with snmpwalk..."
snmpwalk -v2c -c public localhost system
echo "SNMPv2 configuration on OpenWRT completed successfully!"