Skip to content

Instantly share code, notes, and snippets.

@JimHume
Created May 20, 2018 17:46
Show Gist options
  • Save JimHume/08270b1af010dec1fddf79be9ab62715 to your computer and use it in GitHub Desktop.
Save JimHume/08270b1af010dec1fddf79be9ab62715 to your computer and use it in GitHub Desktop.
This gist may help others who have a Netgear Stora that encounters the issue "Error message: at /var/www/admin/update.pm line 346"
#!/bin/bash
# This is the contents of the updated script:
NEW_SCRIPT=$(cat << EOF
package setup_update;
sub process {
return 'success';
}
sub display {
my $vars = shift @_;
my $template = shift @_;
$$vars{'name'} = $name;
die 'Template error: ' . $template->error . "\n" unless $template->process('setup_update.html', $vars);
}
'???';
EOF
)
# Make a backup of the existing file just in case:
cp /var/www/admin/setup_update.pm /var/www/admin/setup_update.pm.bak
# Dump the new script into the old location. Note: this doesn't have to be compiled/turned into bytecode.
# Plain-text perl scripts can be relablled .pm and used as modules.
echo "$NEW_SCRIPT" > /var/www/admin/setup_update.pm
@JimHume
Copy link
Author

JimHume commented May 20, 2018

Note to self: if I ever end up needing this again because I've reset my Stora, don't forget to disable uPnP (!) because it's on by default (!?!?!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment