From dd34652631caa140b9d5edbe2336643ebe14666d Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 15 Apr 2023 02:59:20 +0100 Subject: T671: remove scripts that are not used by anything * vyatta-gettime.pl * vyatta-show-current-user * vyatta-regen-unpriv-commands.sh * vyatta-monitor-list --- Makefile.am | 4 --- scripts/vyatta-gettime.pl | 44 --------------------------------- scripts/vyatta-monitor-list | 21 ---------------- scripts/vyatta-regen-unpriv-commands.sh | 3 --- scripts/vyatta-show-current-user | 20 --------------- 5 files changed, 92 deletions(-) delete mode 100755 scripts/vyatta-gettime.pl delete mode 100644 scripts/vyatta-monitor-list delete mode 100644 scripts/vyatta-regen-unpriv-commands.sh delete mode 100755 scripts/vyatta-show-current-user diff --git a/Makefile.am b/Makefile.am index d66bb69..cceb2f5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,23 +21,19 @@ bin_SCRIPTS = scripts/vyatta-show-interfaces bin_SCRIPTS += scripts/vyatta-show-interfaces.pl bin_SCRIPTS += scripts/vyatta-show-dhclient.pl bin_SCRIPTS += scripts/vyatta-show-dmi -bin_SCRIPTS += scripts/vyatta-gettime.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/vyatta-show-current-user bin_SCRIPTS += scripts/tech-support-archive bin_SCRIPTS += scripts/vyatta-op-cmd-wrapper bin_SCRIPTS += scripts/vyatta-monitor -bin_SCRIPTS += scripts/vyatta-monitor-list bin_SCRIPTS += scripts/vyatta-monitor-cleanup bin_SCRIPTS += scripts/vyatta-monitor-background bin_SCRIPTS += scripts/vyatta-monitor-background-stop bin_SCRIPTS += scripts/vyatta-monitor-check-rule-log sbin_SCRIPTS = scripts/vyatta-image-tools.pl -sbin_SCRIPTS += scripts/vyatta-regen-unpriv-commands.sh sbin_SCRIPTS += scripts/vyos-openvpn-remoteconfig.pl bin_sudo_users_SCRIPTS = scripts/vyatta-delete-log-file.sh diff --git a/scripts/vyatta-gettime.pl b/scripts/vyatta-gettime.pl deleted file mode 100755 index ae0824b..0000000 --- a/scripts/vyatta-gettime.pl +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/perl -# -# Module: vyatta-gettime.pl -# -# **** 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: Stephen Hemminger -# Date: March 2009 -# Description: Script to read time for shutdown -# -# **** End License **** -# - -use strict; -use warnings; -use Date::Format; - -sub gettime { - my $t = shift; - - return time2str( "%R", time ) if ( $t eq 'now' ); - return $t if ( $t =~ /^[0-9]+:[0-9]+/ ); - $t = substr( $t, 1 ) if ( $t =~ /^\+/ ); - return time2str( "%R", time + ( $_ * 60 ) ) if ( $t =~ /^[0-9]+/ ); - - die "invalid time format: $t\n"; -} - -# decode shutdown time -for (@ARGV) { - print gettime($_), "\n"; -} diff --git a/scripts/vyatta-monitor-list b/scripts/vyatta-monitor-list deleted file mode 100644 index 6862f03..0000000 --- a/scripts/vyatta-monitor-list +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -declare CURRENT_PTS=$(tty | sed -e s-/--g -e s/dev//g) -declare CURRENT_UID=$(id -u) -declare -a MPIDS -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 - pts=${pidfile##*-pts} - pts=${pts%%.pid} - if [[ "pts$pts" == "$CURRENT_PTS" ]]; then - if cat /proc/$pid/status | grep -q "Uid:.*$CURRENT_UID" ; then - print=${pidfile##*/} - print=${print%%-pts$pts*} - echo $print - fi - fi - fi -done diff --git a/scripts/vyatta-regen-unpriv-commands.sh b/scripts/vyatta-regen-unpriv-commands.sh deleted file mode 100644 index e6f7e2f..0000000 --- a/scripts/vyatta-regen-unpriv-commands.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -source /opt/vyatta/share/vyatta-op/functions/interpreter/vyatta-unpriv -vyatta_unpriv_gen_allowed diff --git a/scripts/vyatta-show-current-user b/scripts/vyatta-show-current-user deleted file mode 100755 index f55f047..0000000 --- a/scripts/vyatta-show-current-user +++ /dev/null @@ -1,20 +0,0 @@ -#! /bin/bash -# -# Simple script for "show login" - -echo -n "login : " ; who -m - -if [ -n "$VYATTA_USER_LEVEL_DIR" ] -then - echo -n "level : " - basename $VYATTA_USER_LEVEL_DIR -fi - -echo -n "user : " ; id -un -echo -n "groups : " ; id -Gn - -if id -Z >/dev/null 2>&1 -then - echo -n "context : " - id -Z -fi -- cgit v1.2.3