diff options
author | John Estabrook <jestabro@vyos.io> | 2023-09-14 10:05:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-14 10:05:01 -0500 |
commit | b3123af7031e74ee53c215a34d685a421aad5eb3 (patch) | |
tree | f4579275783b696599166af6a47ce451911be023 | |
parent | 63c5b3b55c2e244148a2f7946c7e7cb0792c8a27 (diff) | |
parent | 642afa6d0544e59b05fe957dff4c8c300ef742c0 (diff) | |
download | vyatta-op-b3123af7031e74ee53c215a34d685a421aad5eb3.tar.gz vyatta-op-b3123af7031e74ee53c215a34d685a421aad5eb3.zip |
Merge pull request #70 from c-po/sagitta
Backports from current
39 files changed, 1 insertions, 1337 deletions
diff --git a/Makefile.am b/Makefile.am index 4c8fc0d..ab85087 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,8 +7,6 @@ bin_sudo_usersdir = $(bindir)/sudo-users etc_shell_leveldir = $(sysconfdir)/shell/level funcdir = $(datadir)/vyatta-op/functions -func_DATA = functions/tech-support -func_DATA += functions/tech-support-brief interpdir = $(datadir)/vyatta-op/functions/interpreter interp_DATA = functions/interpreter/vyatta-op-run @@ -17,19 +15,14 @@ interp_DATA += functions/interpreter/vyatta-common interp_DATA += functions/interpreter/vyatta-image-complete -bin_SCRIPTS = scripts/vyatta-show-interfaces -bin_SCRIPTS += scripts/vyatta-show-interfaces.pl +bin_SCRIPTS = scripts/vyatta-show-interfaces.pl bin_SCRIPTS += scripts/show-dhcp-leases.pl bin_SCRIPTS += scripts/vyatta-boot-image.pl bin_SCRIPTS += scripts/rename-image.pl bin_SCRIPTS += scripts/show-image-storage.pl -bin_SCRIPTS += scripts/tech-support-archive bin_SCRIPTS += scripts/vyatta-op-cmd-wrapper sbin_SCRIPTS = scripts/vyatta-image-tools.pl -sbin_SCRIPTS += scripts/vyos-openvpn-remoteconfig.pl - -bin_sudo_users_SCRIPTS = scripts/vyatta-delete-log-file.sh all-local: ./gen-unpriv-commands.sh diff --git a/functions/tech-support b/functions/tech-support deleted file mode 100755 index bec6b4c..0000000 --- a/functions/tech-support +++ /dev/null @@ -1,586 +0,0 @@ -# implement "show tech-support" -# usage: tech-support [ save [ <filename> ] ] -# usage: tech-support [ save-uncompressed [ <filename> ] ] -# NOTE: this file is sourced, NOT executed - -function header { - echo - echo ---------------- - echo "$*" - echo ---------------- -} - -# by default send to stdout -OUT=1 -FLAG=0 -REMOTE=0 -DEFAULT_PATH=/config/support -DEFAULT_GROUP=users - -do_rotate () -{ - local count=`ls -t $DEFAULT_PATH/*.tech-support.* 2>/dev/null |wc -l` - if (( count >= 100 )); then - local dfile=`ls -t $DEFAULT_PATH/*.tech-support.* 2>/dev/null |tail -1` - rm -f $dfile >&/dev/null \ - && echo "Removed old tech-support output file '$dfile'" - fi -} - -HOSTNAME=`hostname` -CURTIME=`date +%F-%H%M%S` - if [ "$1" == "save-uncompressed" ]; then - FLAG="1" - elif [ "$1" == "save" ]; then - FLAG="0" - fi - - if [ "$1" == "save" ] || [ "$1" == "save-uncompressed" ]; then - # "save" or save-uncompressed is specified. save output to file. - OUT="$HOSTNAME.tech-support.$CURTIME.txt" - if [ -n "$2" ]; then - if [[ "$2" =~ scp:///* || "$2" =~ ftp:///* ]]; then - REMOTE="1" - else - # File to be saved locally - OUT="$2.$OUT" - fi - fi - -if [[ $OUT != /* ]]; then - # it's not absolute path. save in default path. - mkdir -p $DEFAULT_PATH >& /dev/null - chgrp $DEFAULT_GROUP $DEFAULT_PATH >& /dev/null - chmod 775 $DEFAULT_PATH >& /dev/null - OUT="$DEFAULT_PATH/$OUT" - do_rotate - fi - if ! touch $OUT >& /dev/null; then - echo "Cannot create tech-support file '$OUT'" - exit 1 - fi - if [ $REMOTE != "1" ]; then - echo "Saving output to $OUT ..." - fi -fi - -( -export PATH=/sbin:/usr/sbin:$PATH - -header Show Tech-Support -header CONFIGURATION - -if cli-shell-api validateTmplPath entitlement; then -header Entitlement -show entitlement -fi - -header VyOS Version and Package Changes -show version all - -header Configuration File -cat /opt/vyatta/etc/config/config.boot - -header Running configuration -show configuration - -header Package Repository Configuration File -cat /etc/apt/sources.list - -header User Startup Scripts -cat /etc/rc.local - -header Quagga Configuration -vtysh -c 'show run' - -header INTERFACES - - -header Interfaces -show interfaces - -header Ethernet - -header Interface statistics -ip -s link show - -for eth in $(${vyos_completion_dir}/list_interfaces.py --type=ethernet) -do header "Physical Interface statistics for $eth" - sudo ethtool -S $eth -done - -for eth in $(${vyos_completion_dir}/list_interfaces.py --type=ethernet) -do header "Physical Interface Details for $eth" - show interfaces ethernet $eth physical - /sbin/ethtool -k $eth -done - -header "ARP Table (Total entries)" -show arp - -header Number of incomplete entries in ARP table -show arp | grep incomplete | wc -l - -header Bridge -/sbin/brctl show -for br in $(${vyos_completion_dir}/list_interfaces.py --type=bridge) -do header "Bridge Information for $br" - /sbin/brctl showstp $br - /sbin/brctl showmacs $br -done - - -header ROUTING - - -function show_route_limit () -{ - NUM=$(show $1 route $2 | wc -l) - # subtract 3 lines of header - [ $NUM -gt 3 ] && NUM=$[$NUM - 3] - OUTPUT=$(echo show $1 route $2 \(total $NUM\)) - CMD="show $1 route $2" - if [ $3 -eq 0 ] - then - header $OUTPUT - vtysh -c "$CMD" - else - header "$OUTPUT- limit $3" - vtysh -c "$CMD" | head -n $3 - fi -} - -# -# show all connected/static, limit the output others and include a total -# -show_route_limit ip connected 0 -show_route_limit ip static 0 -show_route_limit ip rip 500 -show_route_limit ip ospf 500 -show_route_limit ip bgp 500 -show_route_limit ip '' 500 - -show_route_limit ipv6 connected 0 -show_route_limit ipv6 static 0 -show_route_limit ipv6 ripng 500 -show_route_limit ipv6 ospf6 500 -show_route_limit ipv6 bgp 500 -show_route_limit ipv6 '' 500 - - -header IPTABLES - - -header Filter Chain Details -sudo /sbin/iptables -L -vn - -header Nat Chain Details -sudo /sbin/iptables -t nat -L -vn - -header Mangle Chain Details -sudo /sbin/iptables -t mangle -L -vn - -header Raw Chain Details -sudo /sbin/iptables -t raw -L -vn - -header Save Iptables Rule-Set -sudo iptables-save -c - -header SYSTEM - -header Show System Image Version -show system image version - -header Show System Image Storage -show system image storage - -header Current Time -date - -header Installed Packages -dpkg -l - -header Loaded Modules -cat /proc/modules - -header CPU - -header Installed CPU/s -lscpu - -header Cumulative CPU Time Used by Running Processes -top -n1 -b -S - -header Hardware Interrupt Counters -cat /proc/interrupts - -header Load Average -cat /proc/loadavg - -header Running Processes -ps -ef - -header Memory - -header Installed Memory -cat /proc/meminfo - -header Memory Usage -free - -header Storage - -header Devices -cat /proc/devices - -header Partitions -cat /proc/partitions - -disks=`cat /proc/partitions | awk '{ if ($4!="name") { print $4 } }' | egrep -v "[0-9]$" | egrep -v "^$"` - -for disk in $disks; do - header "Partitioning for disk $disk" - fdisk -l /dev/$disk -done - -header Mounts -cat /proc/mounts - -header Diskstats -cat /proc/diskstats - -header Hard Drive Usage -df -h -x squashfs - -header General System - -header Boot Messages -cat /var/log/dmesg - -header "Recent Kernel messages (dmesg)" -dmesg - -header PCI Info -sudo lspci -vvx - -header PCI Vendor and Device Codes -sudo lspci -nn - -header GRUB Command line -cat /proc/cmdline - -header Open Ports -sudo lsof -P -n -i - -header System Startup Files -ls -l /etc/rc?.d - -header Bash History -eval "cfg_users=($(cli-shell-api listActiveNodes system login user))" -for user in "${cfg_users[@]}"; do - header "Bash History for $user"; - case $user in - root) file="/root/.bash_history";; - *) file="/home/$user/.bash_history";; - esac; - sudo cat $file | gawk '/^#[0-9]*/ {t = substr($0,2); next} {print strftime("%FT%T%z", t) " " $0}' | sort -u -done - -header Login History -last -ix - -header Recent Log Messages -tail -n 250 /var/log/messages - -header NTP -show ntp - -### -# End of Core section -### - - -header BGP -if cli-shell-api existsActive protocols bgp; then - header BGP Summary - show ip bgp summary - header BGP Neighbors - show ip bgp neighbors - header BGP Debugging Information - show monitoring protocols bgp -else - echo "BGP is not configured" -fi - -header CLUSTERING -if cli-shell-api existsActive cluster; then - header Cluster Status - show cluster status -else - echo "Clustering is not configured" -fi - -header DHCP Server -if cli-shell-api existsActive service dhcp-server; then - header DHCP Leases - show dhcp server leases - header DHCP Statistics - show dhcp server statistics -else - echo "DHCP server is not configured" -fi - -header DHCP Client -is_dhcp=`show dhcp client leases | wc -l` -if [ "$is_dhcp" == "1" ]; then -echo "DHCP client is not configured" -else -header DHCP Client Leases -show dhcp client leases -fi - -header DHCPV6 Server -if cli-shell-api existsActive service dhcpv6-server; then - header DHCPV6 Server Status - show dhcpv6 server status - header DHCPV6 Server Leases - show dhcpv6 server leases -else - echo "DHCPV6 Server is not configured" -fi - -header DHCPV6 Relay -if cli-shell-api existsActive service dhcpv6-relay; then - header DHCPV6 Relay Status - show dhcpv6 relay-agent status -else - echo "DHCPV6 Relay is not configured" -fi - -header DHCPV6 Client -is_dhcp=`show dhcpv6 client leases | wc -l` -if [ "$is_dhcp" == "1" ]; then -echo "DHCPV6 client is not configured" -else -header DHCPV6 Client Leases -show dhcpv6 client leases -fi - -header DNS -if cli-shell-api existsActive service dns; then - header DNS Dynamic Status - show dns dynamic status - header DNS Forwarding Statistics - show dns forwarding statistics - header DNS Forwarding Nameservers - show dns forwarding nameservers -else - echo "DNS is not configured" -fi - - -header FIREWALL -if cli-shell-api existsActive firewall; then - header Firewall Group - show firewall group - header Firewall Summary - show firewall summary - header Firewall Statistics - show firewall statistics -else - echo "Firewall is not configured" -fi - -header IPSec -if cli-shell-api existsActive vpn ipsec; then - header IPSec Status - show vpn ipsec status - header IPSec sa - show vpn ipsec sa - header IPSec sa Detail - show vpn ipsec sa detail - header IPSec sa Statistics - show vpn ipsec sa statistics - - header /etc/ipsec.conf - cat /etc/ipsec.conf - - if [ -r /etc/ipsec.secrets ]; then - header /etc/ipsec.secrets - cat /etc/ipsec.secrets - fi -else - echo "IPSec is not configured" -fi - -header NAT -if cli-shell-api existsActive nat; then - header NAT Rules - show nat rules - header NAT Statistics - show nat statistics - header NAT Translations Detail - show nat translations detail -else - echo "NAT is not configured" -fi - - -header FlowAccounting -if cli-shell-api existsActive system flow-accounting; then - show flow-accounting -else - echo "Flow accounting is not configured" -fi - -header OPENVPN -if cli-shell-api existsActive interfaces openvpn; then - header OpenVPN Interfaces - show interfaces openvpn detail - header OpenVPN Server Status - show openvpn status server -else - echo "OpenVPN is not configured" -fi - -header OSPF -if cli-shell-api existsActive protocols ospf; then - header OSPF Neighbor - show ip ospf neighbor - header OSPF Route - show ip ospf route - header OSPF Debugging Information - show monitoring protocols ospf -else - echo "OSPF is not configured" -fi - -header OSPFV3 -if cli-shell-api existsActive protocols ospfv3; then - header OSPFV3 Debugging Information - show monitoring protocols ospfv3 -else - echo "OSPFV3 is not configured" -fi - -header Policy -if cli-shell-api existsActive policy; then - header IP Route Maps - show ip protocol - header Route-Map - show route-map - #header IP Access Lists - #show ip access-lists - header IP Community List - show ip community-list -else - echo "Policy is not configured" -fi - -header Traffic Policy -if cli-shell-api existsActive traffic-policy; then - header Current Traffic Policies - show queueing -else - echo "Traffic-Policy is not configured" -fi - -header RIP -if cli-shell-api existsActive protocols rip; then - header IP RIP - show ip rip - header RIP Status - show ip rip status - header RIP Debugging Information - show monitoring protocols rip -else - echo "RIP is not configured" -fi - -header RIPNG -if cli-shell-api existsActive protocols ripng; then - header RIPNG Debugging Information - show monitoring protocols ripng -else - echo "RIPNG is not configured" -fi - -header VPN-L2TP -if cli-shell-api existsActive vpn l2tp; then - header VPN ike secrets - show vpn ike secrets - header VPN rsa-keys - show vpn ike rsa-keys - header VPN ike sa - show vpn ike sa - header VPN ike Status - show vpn ike status - header VPN Remote-Access - show vpn remote-access - - header VPN Debug Detail - show vpn debug detail -else - echo "VPN L2TP is not configured" -fi - -header VPN-PPTP -if cli-shell-api existsActive vpn pptp; then - header VPN Remote-Access - show vpn remote-access -else - echo "VPN PPTP is not configured" -fi - -header VRRP -# XXX: not checking if configured, we'd have to walk all VIFs -show vrrp detail - -header WAN LOAD BALANCING -if cli-shell-api existsActive load-balancing wan; then - header Wan Load Balance - show wan-load-balance - header Wan Load Balance Status - show wan-load-balance status - header Wan Load Balance Connection - show wan-load-balance connection -else - echo "Wan Load Balance is not configured" -fi - -header "WEBPROXY/URL-FILTERING" -if cli-shell-api existsActive service webproxy url-filtering; then - header WebProxy Blacklist Categories - show webproxy blacklist categories - header WebProxy Blacklist Domains - show webproxy blacklist domains - header WebProxy Blacklist URLs - show webproxy blacklist urls - header WebProxy Blacklist Log - show webproxy blacklist log summary -else - echo "Webproxy/URL-filtering is not configured" -fi - -header "END OF TECH-SUPPORT FILE" -) 1>&$OUT 2>&1 - -if [ $OUT != "1" ]; then - chgrp $DEFAULT_GROUP $OUT >& /dev/null - chmod 664 $OUT >& /dev/null - if [ $FLAG == "0" ]; then - gzip $OUT - OUT=$OUT.gz - if [ $REMOTE != "1" ]; then - echo "File $OUT is the compressed file." - fi - fi - - if [ $REMOTE != "1" ]; then - echo "Done." - fi -fi - -if [ $REMOTE == "1" ]; then - python3 -c "from vyos.remote import upload; upload(\"$OUT\", \"$2\")" -fi diff --git a/functions/tech-support-brief b/functions/tech-support-brief deleted file mode 100755 index 2c627d0..0000000 --- a/functions/tech-support-brief +++ /dev/null @@ -1,145 +0,0 @@ -# implement "show tech-support brief" -# usage: tech-support [brief] [ save [ <filename> ] ] -# NOTE: this file is sourced, NOT executed - -function header { - echo - echo ---------------- - echo "$*" - echo ---------------- -} - -# by default send to stdout -OUT=1 -FLAG=0 -REMOTE=0 -DEFAULT_PATH=/config/support -DEFAULT_GROUP=users - -do_rotate () -{ - local count=`ls -t $DEFAULT_PATH/*.tech-support.* 2>/dev/null |wc -l` - if (( count >= 100 )); then - local dfile=`ls -t $DEFAULT_PATH/*.tech-support.* 2>/dev/null |tail -1` - rm -f $dfile >&/dev/null \ - && echo "Removed old tech-support brief output file '$dfile'" - fi -} - -HOSTNAME=`hostname` -CURTIME=`date +%F-%H%M%S` -if [ "$1" == "save-uncompressed" ]; then - FLAG="1" -elif [ "$1" == "save" ]; then - FLAG="0" -fi - -if [ "$1" == "save" ] || [ "$1" == "save-uncompressed" ]; then - # "save" or save-uncompressed is specified. save output to file. - OUT="$HOSTNAME.tech-support.$CURTIME.txt" - if [ -n "$2" ]; then - if [[ "$2" =~ scp:///* || "$2" =~ ftp:///* ]]; then - REMOTE="1" - else - #file to be save locally - OUT="$2.$OUT" - fi - fi - - if [[ $OUT != /* ]]; then - # it's not absolute path. save in default path. - mkdir -p $DEFAULT_PATH >& /dev/null - chgrp $DEFAULT_GROUP $DEFAULT_PATH >& /dev/null - chmod 775 $DEFAULT_PATH >& /dev/null - OUT="$DEFAULT_PATH/$OUT" - do_rotate - fi - if ! touch $OUT >& /dev/null; then - echo "Cannot create tech-support file '$OUT'" - exit 1 - fi - if [ $REMOTE != "1" ]; then - echo "Saving output to '$OUT'..." - fi -fi - -( -export PATH=/sbin:/usr/sbin:$PATH - -header Show Tech-Support Brief -header CONFIGURATION - - -header VyOS Version and Package Changes -show version all - -header Running configuration -show configuration - -header INTERFACES - -header Interfaces -show interfaces - -header ROUTING - -function show_route_limit () -{ - NUM=$(show $1 route $2 | wc -l) - # subtract 3 lines of header - [ $NUM -gt 3 ] && NUM=$[$NUM - 3] - OUTPUT=$(echo show $1 route $2 \(total $NUM\)) - CMD="show $1 route $2" - if [ $3 -eq 0 ] - then - header $OUTPUT - vtysh -c "$CMD" - else - header "$OUTPUT- limit $3" - vtysh -c "$CMD" | head -n $3 - fi -} - -# -# show all connected/static, limit the output others and include a total -# -show_route_limit ip connected 0 -show_route_limit ip static 0 -show_route_limit ip rip 500 -show_route_limit ip ospf 500 -show_route_limit ip bgp 500 -show_route_limit ip '' 500 - -show_route_limit ipv6 connected 0 -show_route_limit ipv6 static 0 -show_route_limit ipv6 ripng 500 -show_route_limit ipv6 ospf6 500 -show_route_limit ipv6 bgp 500 -show_route_limit ipv6 '' 500 - - -header Recent 100 Log Messages -show log tail 100 - -header "END OF TECH-SUPPORT BRIEF FILE" -) 1>&$OUT 2>&1 - -if [ $OUT != "1" ]; then - chgrp $DEFAULT_GROUP $OUT >& /dev/null - chmod 664 $OUT >& /dev/null - if [ $FLAG == "0" ]; then - gzip $OUT - OUT=$OUT.gz - if [ $REMOTE != "1" ]; then - echo "File $OUT is the compressed file." - fi - fi - - if [ $REMOTE != "1" ]; then - echo "Done." - fi -fi - -if [ $REMOTE == "1" ]; then - python3 -c "from vyos.remote import upload; upload(\"$OUT\", \"$2\")" -fi diff --git a/scripts/vyatta-delete-log-file.sh b/scripts/vyatta-delete-log-file.sh deleted file mode 100644 index 577106d..0000000 --- a/scripts/vyatta-delete-log-file.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ -e /var/log/user/"$1" ] -then - echo -n "" > /var/log/user/"$1" -else - echo "File does not exist" -fi diff --git a/scripts/vyatta-monitor b/scripts/vyatta-monitor deleted file mode 100755 index 22867e8..0000000 --- a/scripts/vyatta-monitor +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -declare awkmatch="$2" -for i in "${@:3}"; do - awkmatch+="|$i" -done -tail -f /var/log/messages \ - | awk "/$awkmatch/{ \$5=\" $1:\"; for (f=5; f<=NF; ++f) {printf(\"%s \", \$f);}; printf(\"\n\") }" diff --git a/scripts/vyatta-monitor-background b/scripts/vyatta-monitor-background deleted file mode 100755 index 8a5c0cf..0000000 --- a/scripts/vyatta-monitor-background +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -declare awkmatch="$2" -declare pidname="$1" -if [ ! -d /var/run/vyatta/monitor ]; then - sudo mkdir -p /var/run/vyatta/monitor - sudo chmod -R 777 /var/run/vyatta/monitor -fi -for i in "${@:3}"; do - awkmatch+="|$i" -done -pidfile="/var/run/vyatta/monitor/$pidname-`tty| sed -e s-/--g -e s/dev//g`.pid" -if [ -f $pidfile ]; then - pid=$(cat $pidfile) - processname=$(cat /proc/$pid/cmdline 2>/dev/null) - if [[ $processname =~ "tail" ]];then - echo -ne "\n You are already monitoring this service\n\n" - exit 0 - fi -fi -{ ( tail -f -n0 /var/log/messages & echo $! >&3) 3> \ - $pidfile \ - | awk "/$awkmatch/{ \$5=\" $1:\"; for (f=5; f<=NF; ++f) {printf(\"%s \", \$f);}; printf(\"\n\") }" 2>&3 & \ -} 3>&2 2>/dev/null; disown diff --git a/scripts/vyatta-monitor-background-stop b/scripts/vyatta-monitor-background-stop deleted file mode 100755 index c10528f..0000000 --- a/scripts/vyatta-monitor-background-stop +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -declare pidname="$1" -pidfile="/var/run/vyatta/monitor/$pidname-`tty| sed -e s-/--g -e s/dev//g`.pid" -if [ -f $pidfile ]; then - pid=$(cat $pidfile) - processname=$(cat /proc/$pid/cmdline 2>/dev/null) - if [[ $processname =~ "tail" ]];then - kill -9 $pid - rm -f $pidfile - exit 0 - fi -fi -echo -ne "\n You are not currently monitoring this service\n\n" diff --git a/scripts/vyatta-monitor-check-rule-log b/scripts/vyatta-monitor-check-rule-log deleted file mode 100644 index 5466edc..0000000 --- a/scripts/vyatta-monitor-check-rule-log +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -RULE_PATH=$1 -RULE_NUM=$2 - -if ! cli-shell-api existsActive $RULE_PATH rule $RULE_NUM log; then - echo "Warning: logging is not enabled for rule $RULE_NUM" - echo "For proper monitor operation enable logging before issuing this command:" - echo "set $RULE_PATH rule $RULE_NUM log enable" -fi diff --git a/scripts/vyatta-monitor-cleanup b/scripts/vyatta-monitor-cleanup deleted file mode 100644 index 553c1f8..0000000 --- a/scripts/vyatta-monitor-cleanup +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -declare CURRENT_PTS=$(tty | sed -e s-/--g -e s/dev//g) -declare CURRENT_UID=$(id -u) -declare CURRENT_UNAME=$(id -un) -declare -a MPIDS -MODE=$1 -MPIDS=( $(ls /var/run/vyatta/monitor/*.pid 2> /dev/null ) ) - -for pidfile in "${MPIDS[@]}"; do - pid=$(<$pidfile) - procname=$(cat /proc/$pid/cmdline 2>/dev/null) - if [[ "$procname" =~ "tail" ]] ; then - # Clean up tail processes that didn't die on logout - pts=${pidfile##*-pts} - pts=${pts%%.pid} - # If the process isn't attaced to the current PTY - if [[ "pts$pts" != "$CURRENT_PTS" ]]; then - # If I owned this process - if cat /proc/$pid/status | grep -q "Uid:.*$CURRENT_UID" ; then - # If I'm no longer on the pty that process started on - if ! who | grep -q "$CURRENT_UNAME.*pts/$pts" ; then - kill $pid - rm -rf $pidfile - fi - fi - elif [[ "$MODE" == "LOGOUT" ]]; then - # on logout kill all monitors - kill $pid - rm -rf $pidfile - fi - else - # Clean up killed tail processes - rm -rf $pidfile - fi -done - diff --git a/scripts/vyatta-show-interfaces b/scripts/vyatta-show-interfaces deleted file mode 100755 index 262664f..0000000 --- a/scripts/vyatta-show-interfaces +++ /dev/null @@ -1,202 +0,0 @@ -#!/bin/bash -# **** License **** -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# -# 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. -# -# This code was originally developed by Vyatta, Inc. -# Portions created by Vyatta are Copyright (C) 2007 Vyatta, Inc. -# All Rights Reserved. -# -# Author: Tom Grennan -# Date: 2007 -# -# **** End License **** - -shopt -s extglob -shopt -s nullglob - -declare progname=${0##*/} -declare -a full_itfs=( /sys/class/net/+(eno|ens|enp|enx|eth|vmnet|lo|tun|wan|pppoe|pppoa|adsl)* ) -declare -a itfs -declare _do_show=_show_itf_stats - -_error () -{ - ecode=$1 - shift - echo $@ - if [ $ecode -eq 1 ] ; then - echo - _usage - fi - exit $ecode -} - -_show_itf_stats () -{ - local -i rx_bytes rx_packets rx_errors rx_dropped rx_over_errors multicast - local -i tx_bytes tx_packets tx_errors tx_dropped tx_carrier_errors \ - collisions - local -i rx_missed_errors rx_fifo_errors - - for itf ; do - test -d /sys/class/net/$itf || \ - _error 2 $itf: no such interface\! - for stat in \ - rx_bytes rx_packets rx_errors rx_dropped rx_over_errors multicast \ - tx_bytes tx_packets tx_errors tx_dropped tx_carrier_errors \ - collisions - do - full_stat=/sys/class/net/${itf}/statistics/${stat} - if [ -r $full_stat ] ; then - eval $stat=$(cat $full_stat) - else - eval $stat=0 - fi - done - for stat in rx_missed_errors ; do - full_stat=/sys/class/net/${itf}/statistics/${stat} - if [ -r $full_stat ] ; then - let $(( rx_dropped_errors += $(cat $full_stat) )) - fi - done - for stat in rx_fifo_errors ; do - full_stat=/sys/class/net/${itf}/statistics/${stat} - if [ -r $full_stat ] ; then - let $(( rx_over_errors += $(cat $full_stat) )) - fi - done - - printf -v rx_stats \ - '%10d %10d %10d %10d %10d %10d' \ - $rx_bytes \ - $rx_packets \ - $rx_errors \ - $rx_dropped \ - $rx_over_errors \ - $multicast - - printf -v tx_stats \ - '%10d %10d %10d %10d %10d %10d' \ - $tx_bytes \ - $tx_packets \ - $tx_errors \ - $tx_dropped \ - $tx_carrier_errors \ - $collisions - - ip -s addr show ${itf} | sed 's/^[0-9]*: //' - cat <<-EOF - - RX: bytes packets errors dropped overrun mcast - $rx_stats - TX: bytes packets errors dropped carrier collisions - $tx_stats - - EOF - done -} - -_show_itf_physical () -{ - for eth ; do - /sbin/ethtool $eth - echo - done -} - -_usage () -{ - cat <<-EOF - $progname [ INTERFACE ] - $progname loopback [ INTERFACE ] - $progname tunnel [ INTERFACE ] - $progname serial [ INTERFACE ] - $progname pppoe [ INTERFACE ] - $progname pppoa [ INTERFACE ] - $progname adsl [ INTERFACE ] - $progname system [ enabled ] - EOF -} - -_add_itfs () -{ - for itf ; do - if [[ $itf != +(eno|ens|enp|enx|eth|vmnet|lo|tun|wan|pppoe|pppoa|adsl)* ]] ; then - _error 2 \""$itf"\" is not an interface name\! - elif [ ! -d /sys/class/net/$itf ] ; then - _error 2 $itf: no such interface\! - else - itfs+=( $itf ) - fi - done -} - -if [ $# -gt 0 ] ; then - if [[ $1 == --+(usage|help) ]] ; then - _usage - exit 0 - elif [[ $1 == +(ethernet|loopback|system|tunnel|serial|pppoe|pppoa|adsl) ]] ; then - if [ $# -eq 1 ] ; then - case $1 in - ethernet ) - full_itfs=( /sys/class/net/+(eno|ens|enp|enx|eth|vmnet)* ) ;; - loopback ) - full_itfs=( /sys/class/net/lo* ) ;; - tunnel ) - full_itfs=( /sys/class/net/tun* ) ;; - serial ) - full_itfs=( /sys/class/net/wan* ) ;; - pppoe ) - full_itfs=( /sys/class/net/pppoe* ) ;; - pppoa ) - full_itfs=( /sys/class/net/pppoa* ) ;; - adsl ) - full_itfs=( /sys/class/net/adsl* ) ;; - esac - itfs=( ${full_itfs[@]##*/} ) - else - if [[ $1 == system ]] ; then - if [[ $2 == enabled ]] ; then - for full_itf in ${full_itfs[@]} ; do - let -i flags="$(cat $full_itf/flags) & 1" - [[ $flags -eq 1 ]] && _add_itfs ${full_itf##*/} - done - fi - else - _add_itfs $2 - if [ $# -gt 2 ] ; then - if [[ $3 == physical ]] ; then - _do_show=_show_itf_physical - elif [[ $3 == vif ]] ; then - if [ $# -gt 3 ] ; then - itfs+=.$4 - if [[ $# -gt 4 && $4 == physical ]] ; then - _do_show=_show_itf_physical - fi - else - _error 2 missing VIF number\! - fi - fi - fi - fi - fi - else - _add_itfs $* - fi -else - itfs=( ${full_itfs[@]##*/} ) -fi - -eval $_do_show ${itfs[@]} - -# Local Variables: -# mode: shell-script -# sh-indentation: 4 -# End: diff --git a/scripts/vyos-openvpn-remoteconfig.pl b/scripts/vyos-openvpn-remoteconfig.pl deleted file mode 100644 index 6412364..0000000 --- a/scripts/vyos-openvpn-remoteconfig.pl +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/perl -# -# Copyright (C) 2017 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 or later as -# published by the Free Software Foundation. -# -# 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/>. - -use lib "/opt/vyatta/share/perl5/"; -use Vyatta::Config; - -use warnings; -use strict; - -sub auth_warning -{ - print("NOTE: authentication options are deliberately left out,\n"); - print("since we cannot know file paths on a remote system\n\n"); -} - -my $config = new Vyatta::Config; - -if(!$config->inSession()) { - print("This command can only be used from configuration mode!"); - exit(1); -} - -my $intf = $ARGV[0]; -if(!defined($intf)) -{ - print("OpenVPN interface is not specified!\n"); - exit(1); -} - -my $remote = $ARGV[1]; -if(!defined($remote)) -{ - print("Remote side platform is not specified!\n"); - exit(1); -} - -if(!$config->exists("interfaces openvpn $intf")) -{ - print("OpenVPN interface $intf does not exist!\n"); - exit(1); -} - -$config->setLevel("interfaces openvpn $intf"); - -my $mode = $config->returnValue('mode'); - -my $localhost = $config->returnValue("local-host"); -my $localport = $config->returnValue("local-port"); -my $remotehost = $config->returnValue("remote-host"); -my $remoteaddr = $config->returnValue("remote-address"); -my $remoteport = $config->returnValue("remote-port"); -my $cipher = $config->returnValue("encryption"); -my $hash = $config->returnValue("hash"); -my $protocol = $config->returnValue("protocol"); -my $persist = $config->exists("persistent-tunnel"); -my $tlsrole = $config->returnValue("tls role"); -my $devtype = $config->returnValue("device-type"); -my @options = $config->returnValues("openvpn-option"); - -# local-addr is a tag node... -# Let's limit it to only the first address for now, -# since remote-address is limited to only one address anyway! -my @localaddrs = $config->listNodes('local-address'); -my $localaddr = undef; -if(@localaddrs) { - $localaddr = $localaddrs[0]; -} - -if($mode eq 'client') -{ - print("It is impossible to produce a complete server config from a client config!\n"); - exit(1); -} -elsif($mode eq 'site-to-site') -{ - if($remote eq 'vyos') - { - auth_warning; - - print("edit interfaces openvpn $intf\n"); - print("set mode site-to-site\n"); - print("set device-type $devtype\n") if defined($devtype); - print("set remote-host $localhost\n") if defined($localhost); - print("set remote-address $localaddr\n") if defined($localaddr); - print("set remote-port $localport\n") if defined($localport); - print("set local-host $remotehost\n") if defined($remotehost); - print("set local-address $remoteaddr\n") if defined($remoteaddr); - print("set local-port $remoteport\n") if defined($remoteport); - print("set protocol $protocol\n") if defined($protocol); - print("set encryption $cipher\n") if defined($cipher); - print("set hash $hash\n") if defined($hash); - - for my $o (@options) { print("set openvpn-option \"$o\"\n"); } - - print "tls role passive\n" if (defined($tlsrole) && ($tlsrole eq 'active')); - print "tls role active\n" if (defined($tlsrole) && ($tlsrole eq 'passive')); - print("top\n"); - } -} -elsif($mode eq 'server') -{ - if($remote eq 'vyos') - { - auth_warning; - - print("edit interfaces openvpn $intf\n"); - print("set mode client"); - print("set device-type $devtype\n") if defined($devtype); - print("set remote-host $localhost\n") if defined($localhost); - print("set remote-port $localport\n") if defined($localport); - print("set protocol $protocol\n") if defined($protocol); - print("top\n"); - } -} diff --git a/templates/delete/log/file/node.def b/templates/delete/log/file/node.def deleted file mode 100644 index 96d455d..0000000 --- a/templates/delete/log/file/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Delete the specified log file diff --git a/templates/delete/log/file/node.tag/node.def b/templates/delete/log/file/node.tag/node.def deleted file mode 100644 index ce4a4f7..0000000 --- a/templates/delete/log/file/node.tag/node.def +++ /dev/null @@ -1,5 +0,0 @@ -help: Delete the specified log file -allowed: local -a array ; - array=( /var/log/user/* ) ; - echo -n ${array[@]##*/} -run: sudo ${vyatta_bindir}/sudo-users/vyatta-delete-log-file.sh "$4" diff --git a/templates/delete/log/node.def b/templates/delete/log/node.def deleted file mode 100644 index badd128..0000000 --- a/templates/delete/log/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Delete a log file diff --git a/templates/release/dhcp/interface/node.tag/node.def b/templates/release/dhcp/interface/node.tag/node.def index f483278..3f6831c 100644 --- a/templates/release/dhcp/interface/node.tag/node.def +++ b/templates/release/dhcp/interface/node.tag/node.def @@ -1,3 +1,2 @@ help: Release DHCP IP address lease for specified interface -allowed: /opt/vyatta/bin/show-dhcp-leases.pl run: sudo /opt/vyatta/bin/sudo-users/vyatta-interfaces.pl --dhcp release --dev "$4" diff --git a/templates/show/remote-config/openvpn/node.def b/templates/show/remote-config/openvpn/node.def deleted file mode 100644 index d417cb6..0000000 --- a/templates/show/remote-config/openvpn/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Show remote side config for OpenVPN diff --git a/templates/show/remote-config/openvpn/node.tag/node.def b/templates/show/remote-config/openvpn/node.tag/node.def deleted file mode 100644 index afb8cfb..0000000 --- a/templates/show/remote-config/openvpn/node.tag/node.def +++ /dev/null @@ -1,5 +0,0 @@ -help: Show remote side OpenVPN config - -allowed: local -a array ; - eval "array=( $(cli-shell-api listEffectiveNodes interfaces openvpn) )" ; - echo -n '<vtunN>' ${array[@]##*/} diff --git a/templates/show/remote-config/openvpn/node.tag/remote-platform/node.def b/templates/show/remote-config/openvpn/node.tag/remote-platform/node.def deleted file mode 100644 index 15502c9..0000000 --- a/templates/show/remote-config/openvpn/node.tag/remote-platform/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Show remote side OpenVPN config for specified platform diff --git a/templates/show/remote-config/openvpn/node.tag/remote-platform/node.tag/node.def b/templates/show/remote-config/openvpn/node.tag/remote-platform/node.tag/node.def deleted file mode 100644 index 66f334c..0000000 --- a/templates/show/remote-config/openvpn/node.tag/remote-platform/node.tag/node.def +++ /dev/null @@ -1,9 +0,0 @@ -help: Show remote side OpenVPN config for specified platform -allowed: echo -n "vyos openvpn" - -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - sudo ${vyatta_sbindir}/vyos-openvpn-remoteconfig.pl $4 $6 - else - echo Must be an admin user to run this command. - fi diff --git a/templates/show/tech-support/brief/node.def b/templates/show/tech-support/brief/node.def deleted file mode 100644 index 9a4a624..0000000 --- a/templates/show/tech-support/brief/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Show brief tech-support report (private information removed) -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief | strip-private - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/brief/save-uncompressed/node.def b/templates/show/tech-support/brief/save-uncompressed/node.def deleted file mode 100644 index 84b4ed0..0000000 --- a/templates/show/tech-support/brief/save-uncompressed/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Save uncompressed brief tech-support report (private information removed) -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save-uncompressed | strip-private - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/brief/save-uncompressed/node.tag/node.def b/templates/show/tech-support/brief/save-uncompressed/node.tag/node.def deleted file mode 100644 index dad3949..0000000 --- a/templates/show/tech-support/brief/save-uncompressed/node.tag/node.def +++ /dev/null @@ -1,8 +0,0 @@ -help: Save uncompressed brief tech-support report to specified path/file (private information removed) -allowed: echo -n '<file> <scp://<user>:<passwd>@<host>/<file>> <ftp://<user>:<passwd>@<host>/<file>>' -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save-uncompressed $5 | strip-private - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/brief/save/node.def b/templates/show/tech-support/brief/save/node.def deleted file mode 100644 index 2f8a561..0000000 --- a/templates/show/tech-support/brief/save/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Save brief tech-support report (private information removed) -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save | strip-private - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/brief/save/node.tag/node.def b/templates/show/tech-support/brief/save/node.tag/node.def deleted file mode 100644 index f0cfe4a..0000000 --- a/templates/show/tech-support/brief/save/node.tag/node.def +++ /dev/null @@ -1,8 +0,0 @@ -help: Save compressed brief tech-support report to specified path/file (private information removed) -allowed: echo -n '<file> <scp://<user>:<passwd>@<host>/<file>> <ftp://<user>:<passwd>@<host>/<file>>' -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save $5 | strip-private - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/node.def b/templates/show/tech-support/node.def deleted file mode 100644 index c211e90..0000000 --- a/templates/show/tech-support/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Show consolidated tech-support report (private information removed) -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support | strip-private - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/private/brief/node.def b/templates/show/tech-support/private/brief/node.def deleted file mode 100644 index cc06ccf..0000000 --- a/templates/show/tech-support/private/brief/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Show brief tech-support report (contains private information) -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/private/brief/save-uncompressed/node.def b/templates/show/tech-support/private/brief/save-uncompressed/node.def deleted file mode 100644 index 9292428..0000000 --- a/templates/show/tech-support/private/brief/save-uncompressed/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Save uncompressed brief tech-support report (contains private information) -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save-uncompressed - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/private/brief/save-uncompressed/node.tag/node.def b/templates/show/tech-support/private/brief/save-uncompressed/node.tag/node.def deleted file mode 100644 index 0976413..0000000 --- a/templates/show/tech-support/private/brief/save-uncompressed/node.tag/node.def +++ /dev/null @@ -1,8 +0,0 @@ -help: Save uncompressed brief tech-support report to specified path/file (contains private information) -allowed: echo -n '<file> <scp://<user>:<passwd>@<host>/<file>> <ftp://<user>:<passwd>@<host>/<file>>' -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save-uncompressed $5 - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/private/brief/save/node.def b/templates/show/tech-support/private/brief/save/node.def deleted file mode 100644 index d069ec2..0000000 --- a/templates/show/tech-support/private/brief/save/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Save brief tech-support report (contains private information) -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/private/brief/save/node.tag/node.def b/templates/show/tech-support/private/brief/save/node.tag/node.def deleted file mode 100644 index f56d02e..0000000 --- a/templates/show/tech-support/private/brief/save/node.tag/node.def +++ /dev/null @@ -1,8 +0,0 @@ -help: Save compressed brief tech-support report to specified path/file (contains private information) -allowed: echo -n '<file> <scp://<user>:<passwd>@<host>/<file>> <ftp://<user>:<passwd>@<host>/<file>>' -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save $5 - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/private/node.def b/templates/show/tech-support/private/node.def deleted file mode 100644 index 32b4c15..0000000 --- a/templates/show/tech-support/private/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Show consolidated tech-support report (contains private information) -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/private/save-uncompressed/node.def b/templates/show/tech-support/private/save-uncompressed/node.def deleted file mode 100644 index 424e78a..0000000 --- a/templates/show/tech-support/private/save-uncompressed/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Save consolidated tech-support report uncompressed (contains private information) -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support save-uncompressed - else - echo Must be an admin user to run this command. - fi diff --git a/templates/show/tech-support/private/save-uncompressed/node.tag/node.def b/templates/show/tech-support/private/save-uncompressed/node.tag/node.def deleted file mode 100644 index f2f7572..0000000 --- a/templates/show/tech-support/private/save-uncompressed/node.tag/node.def +++ /dev/null @@ -1,8 +0,0 @@ -help: Save uncompressed tech-support report to specified path/file (contains private information) -allowed: echo -n '<file> <scp://<user>:<passwd>@<host>/<file>> <ftp://<user>:<passwd>@<host>/<file>>' -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support save-uncompressed $4 - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/private/save/node.def b/templates/show/tech-support/private/save/node.def deleted file mode 100644 index 87819f6..0000000 --- a/templates/show/tech-support/private/save/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Save consolidated tech-support report (contains private information) -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support save - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/private/save/node.tag/node.def b/templates/show/tech-support/private/save/node.tag/node.def deleted file mode 100644 index 5a7b500..0000000 --- a/templates/show/tech-support/private/save/node.tag/node.def +++ /dev/null @@ -1,8 +0,0 @@ -help: Save compressed tech-support report to the specified path/file (contains private information) -allowed: echo -n '<file> <scp://<user>:<passwd>@<host>/<file>> <ftp://<user>:<passwd>@<host>/<file>>' -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support save $4 - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/save-uncompressed/node.def b/templates/show/tech-support/save-uncompressed/node.def deleted file mode 100644 index 4d828f1..0000000 --- a/templates/show/tech-support/save-uncompressed/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Save consolidated tech-support report uncompressed (private information removed) -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support save-uncompressed | strip-private - else - echo Must be an admin user to run this command. - fi diff --git a/templates/show/tech-support/save-uncompressed/node.tag/node.def b/templates/show/tech-support/save-uncompressed/node.tag/node.def deleted file mode 100644 index 4006afe..0000000 --- a/templates/show/tech-support/save-uncompressed/node.tag/node.def +++ /dev/null @@ -1,8 +0,0 @@ -help: Save uncompressed tech-support report to specified path/file (private information removed) -allowed: echo -n '<file> <scp://<user>:<passwd>@<host>/<file>> <ftp://<user>:<passwd>@<host>/<file>>' -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support save-uncompressed $4 | strip-private - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/save/node.def b/templates/show/tech-support/save/node.def deleted file mode 100644 index ee1a2f1..0000000 --- a/templates/show/tech-support/save/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Save consolidated tech-support report (private information removed) -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support save | strip-private - else - echo Must be an admin user to run this command - fi diff --git a/templates/show/tech-support/save/node.tag/node.def b/templates/show/tech-support/save/node.tag/node.def deleted file mode 100644 index 675418b..0000000 --- a/templates/show/tech-support/save/node.tag/node.def +++ /dev/null @@ -1,8 +0,0 @@ -help: Save compressed tech-support report to the specified path/file (private information removed) -allowed: echo -n '<file> <scp://<user>:<passwd>@<host>/<file>> <ftp://<user>:<passwd>@<host>/<file>>' -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - source ${vyatta_datadir}/vyatta-op/functions/tech-support save $4 | strip-private - else - echo Must be an admin user to run this command - fi |