Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ######################################################################
- #Copyright (C) 2021 Kris Occhipinti
- #https://filmsbykris.com
- #This program is free software: you can redistribute it and/or modify
- #it under the terms of the GNU General Public License as published by
- #the Free Software Foundation, either version 3 of the License, or
- #(at your option) any later version.
- #This program is distributed in the hope that it will be useful,
- #but WITHOUT ANY WARRANTY; without even the implied warranty of
- #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- #GNU General Public License for more details.
- #You should have received a copy of the GNU General Public License
- #along with this program. If not, see <http://www.gnu.org/licenses/>.
- ######################################################################
- echo "Getting Server Info..."
- server="$(upnpc -l | grep desc:|awk '{print $2}')"
- ip="$(ip a|grep "inet "|awk '{print $2}'|cut -d\/ -f1|tail -n1)"
- read -p "Interal Port: " internal
- read -p "External Port: " external
- read -p "Description: " description
- upnpc -u $server -d $external tcp
- echo "upnpc -u $server -a $ip $internal $external tcp"
- echo ": $(date +%s):0;upnpc -u $server -a $ip $internal $external tcp" > $HOME/.zsh_history
- upnpc -u $server -a $ip $internal $external tcp
- echo -e "\n\nTo delete port run:\nupnpc -u $server -d $external tcp"
- echo ": $(date +%s):0;upnpc -u $server -d $external tcp" > $HOME/.zsh_history
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement