Skip to content

Commit

Permalink
fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
JuniperChris929 committed Sep 21, 2023
1 parent 801042e commit 09a6aa0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
<p class="has-line-data" data-line-start="2" data-line-end="3">I was tired of remembering the needed commands (and probably forgetting some) and the manual time it took me to collect all the Infos.</p>
<p class="has-line-data" data-line-start="4" data-line-end="6">Run this script in python (if you don't trust my .exe) or use the compiled .exe (created via pyinstaller).<br>
The .exe is useful when you don’t have python on your (or your customers) machine.</p>
<p class="has-line-data" data-line-start="7" data-line-end="8">Run it (not as root, but as any user), give it the Switches IP, user and password and sit back (probably get a coffee or tea).</p>
<p class="has-line-data" data-line-start="9" data-line-end="11">If you have any questions or find bugs feel free to contact me on Twitter (@chsjuniper) <br>or send me a Mail (chs [at] ip4 [dot] de)<br>
<p class="has-line-data" data-line-start="7" data-line-end="8">Run it (NOT as root, but as any user), give it the device-IP, user and password and sit back (probably get a coffee or tea).</p>
<p class="has-line-data" data-line-start="9" data-line-end="11">If you have any questions or find bugs feel free to contact me via mail (chs [at] ip4 [dot] de)<br>
<p class="has-line-data" data-line-start="12" data-line-end="13">Simply upload the created package to JTAC.</p>
<p class="has-line-data" data-line-start="14" data-line-end="15">Do NOT upload the njsupport-live.log - this is for your Info only in case something in the script goes wrong. JTAC will probably not know what to do with that file because it contains almost nothing about your Device ;)</p>
<br>Disclaimer: This Tool is for free use on your own risk. I'm not employed by Juniper - just trying to automate my Tasks ;)
<p class="has-line-data" data-line-start="14" data-line-end="15">Do NOT upload the njs_DATE.log - this is for your info only in case something in the script goes wrong. JTAC will probably not know what to do with that file because it contains almost nothing about your Device ;)</p>
<br>Disclaimer: This tool is for free use on your own risk. I'm not employed by Juniper - just trying to automate my tasks ;)
<br>
<br>
<br>Support for the root-user will also be added in the future.
<br>If you are missing something or have an idea please let me know.
<br>Let's make the world a better place :)
23 changes: 11 additions & 12 deletions njsupport.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Developed by Christian Scholz [Mail: [email protected], Twitter: @chsjuniper]
# Feel free to use and modify this script as needed
# Use at your own risk
# This is a hobby project - I'm currently not employed by Juniper
# Developed by Christian Scholz [Mail: [email protected], Mastodon: @[email protected], Twitter: @chsjuniper]
# Feel free to use and modify this script as needed but use at your own risk!
# This is a hobby project - I'm not employed by Juniper.
# I just wanted a tool that helps me doing my every day work a bit faster and more consistent
# Also I'm new to python so this code can possibly be optimized to do more in less lines ;)
# You've been warned ;)

import os
import sys
Expand All @@ -18,10 +17,10 @@
from datetime import datetime
from jnpr.junos.utils.start_shell import StartShell

varIP = input("Please enter the Hostname or IP of your target Device: ")
varUser = input("Please Enter a Username (not root): ")
varIP = input("Please enter the hostname or IP of your target device: ")
varUser = input("Please enter a username (not root): ")
varPassword = getpass.getpass()
version_arg = "2021.02.09.7225"
version_arg = "2023.09.21.9773"
now = datetime.now()
dir_config = 'configuration'
dir_rsi = 'rsi'
Expand All @@ -33,12 +32,12 @@
# pyinstaller -F -i Icon.ico -n Output-Filename script-source.py

# Set up logging
log = "njs.log"
log = "njs_" + date_arg + ".log"
logging.basicConfig(filename=log, level=logging.DEBUG, format='%(asctime)s %(message)s', datefmt='%d/%m/%Y %H:%M:%S')

if str(varUser) == 'root':
sys.exit(
'Unfortunately the user root is currently not supported - Please run the tool again and choose another user.')
'Which part of NOT root did you not understand? - Please run the tool again and choose another user.')

while True:
try:
Expand All @@ -60,9 +59,9 @@
print("# Version:", version_arg, " #")
print("# This script will run all necessary troubleshooting commands for you. #")
print("# #")
print("# WARNING: Please leave this Window open and running. #")
print("# WARNING: Please leave this window open and running. #")
print("# #")
print("# After the Program is finished, it will automatically close itself. #")
print("# After the program is finished, it will automatically close itself. #")
print("# #")
print("###############################################################################")
print("\n")
Expand Down

0 comments on commit 09a6aa0

Please sign in to comment.