summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2023-05-05 20:19:46 +0100
committerDaniil Baturin <daniil@baturin.org>2023-05-05 20:30:43 +0100
commitf99ae0b453ac0f1f57192656f27536ab5e8a7463 (patch)
tree590d5431c90aa6a5d9531271a1c17989a23544f4
parent4af276ff4f495a4d130f6857fed2393c8a90b612 (diff)
downloadvyatta-cfg-system-f99ae0b453ac0f1f57192656f27536ab5e8a7463.tar.gz
vyatta-cfg-system-f99ae0b453ac0f1f57192656f27536ab5e8a7463.zip
T671: remove more dead scripts
-rw-r--r--Makefile.am4
-rw-r--r--scripts/check_file_in_config_dir32
-rwxr-xr-xscripts/vyatta-address69
-rw-r--r--scripts/vyatta-tunnel-dhcp.pl28
-rw-r--r--scripts/vyatta-update-tunnel.pl27
5 files changed, 0 insertions, 160 deletions
diff --git a/Makefile.am b/Makefile.am
index 88a1dedb..627e0bda 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,10 +13,6 @@ checkparamsonreboot_SCRIPTS =
bin_SCRIPTS += scripts/progress-indicator
bin_SCRIPTS += scripts/restricted-shell
-bin_sudo_users_SCRIPTS += scripts/vyatta-tunnel-dhcp.pl
-sbin_SCRIPTS += scripts/vyatta-update-tunnel.pl
-
-sbin_SCRIPTS += scripts/check_file_in_config_dir
sbin_SCRIPTS += scripts/vyatta-grub-setup
sbin_SCRIPTS += scripts/standalone_root_pw_reset
sbin_SCRIPTS += scripts/snmp/if-mib-alias
diff --git a/scripts/check_file_in_config_dir b/scripts/check_file_in_config_dir
deleted file mode 100644
index bceb2858..00000000
--- a/scripts/check_file_in_config_dir
+++ /dev/null
@@ -1,32 +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) 2011 Vyatta, Inc.
-# All Rights Reserved.
-#
-# Author: Mohit Mehta <mohit@vyatta.com>
-# Description: Check if the given file is under /config. Used for files that
-# are referenced from the CLI and need to be preserved during
-# image upgrade. Warn the user if these aren't under /config
-#
-# **** End License ****
-
-FILE=$1
-CONFIG_DIR=$2
-
-if [[ ( $FILE =~ ^\/config\/.*$ ) || \
- ( $FILE =~ ^\/opt\/vyatta\/etc\/config\/.*$ ) ]]; then
- exit 0
-else
- echo Warning: \'$FILE\' lies outside of $CONFIG_DIR directory. \
- It will not get preserved during image upgrade.
-fi
diff --git a/scripts/vyatta-address b/scripts/vyatta-address
deleted file mode 100755
index ed9a298e..00000000
--- a/scripts/vyatta-address
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/bash
-#
-# Wrapper around ip link command that handles IPv4, IPv6 and DHCP
-# This is done in shell rather than perl to avoid the overhead of recompilation
-
-if [ $# -ne 3 ]; then
- echo "Usage: $0 {add|delete} interface address"
- exit 1
-fi
-
-case $1 in
- add)
- if [[ "$3" = "dhcp" ]]; then
- exec /opt/vyatta/sbin/vyatta-interfaces.pl --dev="$2" --dhcp=start
- elif [[ "$3" = "dhcpv6" ]]; then
- exec /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --start -ifname "$2"
- elif [[ "$3" =~ ":" ]]; then
- # Ipv6 address
- if ! ip -6 addr list dev $2 | grep -q $3; then
- exec sudo ip -6 addr add "$3" dev "$2"
- fi
- else
- if ! ip addr list dev $2 | grep -q $3; then
- exec sudo ip addr add "$3" broadcast + dev "$2"
- fi
- fi ;;
-
- delete)
- # Get current address from interface when using DHCP
- if [[ "$3" = "dhcp" ]]; then
- lease_file=/var/lib/dhcp/dhclient_"$(echo $2 | sed -e 's/\./_/')".leases;
- ip=$(sed -n 's/^\s\sfixed-address\s\(.*\);/\1/p' $lease_file | sed -n '$p');
- #ip_address=$(sed -n 's/^\s\sfixed-address\s\(.*\);/\1/p' $lease_file | sed -n '$p');
- # T1053 we need IP/prefix for normalize-ip to function
- ip_address=$(ip a s dev $2 | grep "inet $ip" | awk '{print $2}')
- elif [[ "$3" = "dhcpv6" ]]; then
- lease_file=/var/lib/dhcp/dhclient_v6_"$(echo $2 | sed -e 's/\./_/')".leases;
- ip_address=$(sed -n 's/^\s\s\s\siaaddr\s\(.*\)\s{/\1/p' $lease_file | sed -n '$p');
- else
- ip_address=$3;
- fi
- if [[ "$ip_address" = "" ]]; then
- ip_address='0.0.0.0/0'
- fi
-
- ### T1053 parameter $ip_address needs to be prefixed, not just the IP
- ip_address=$(/usr/libexec/vyos/system/normalize-ip $ip_address)
-
- if ! ip address show dev $2 2>/dev/null | grep -q "$ip_address"; then
- # Address doesn't exist there, nothing to delete
- exit 0
- fi
-
- if [ ! -d "/sys/class/net/$2" ]; then
- # device is already gone
- exit 0
- elif [[ "$3" = "dhcp" ]]; then
- exec /opt/vyatta/sbin/vyatta-interfaces.pl --dev="$2" --dhcp=stop
- elif [[ "$3" = "dhcpv6" ]]; then
- exec /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --stop --ifname "$2"
- elif [[ "$3" =~ ":" ]]; then
- exec sudo ip -6 addr del "$ip_address" dev "$2"
- else
- exec sudo ip addr del "$ip_address" dev "$2"
- fi ;;
- *)
- echo "Unknown option $1"
- exit 1 ;;
-esac
diff --git a/scripts/vyatta-tunnel-dhcp.pl b/scripts/vyatta-tunnel-dhcp.pl
deleted file mode 100644
index cc51483d..00000000
--- a/scripts/vyatta-tunnel-dhcp.pl
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/perl
-use Getopt::Long;
-use strict;
-
-my ($iface, $dhcp, $tunnel, $nip, $oip, $reason);
-GetOptions("interface=s" => \$iface,
- "dhcp=s" => \$dhcp,
- "tunnel=s" => \$tunnel,
- "new_ip=s" => \$nip,
- "old_ip=s" => \$oip,
- "reason=s" => \$reason);
-
-# check if an update is needed
-if (($reason eq "BOUND") || ($reason eq "REBOOT")) {
- $oip = "";
-}
-exit(0) if (($iface ne $dhcp) || ($oip eq $nip));
-logger("DHCP address on $iface updated to $nip from $oip: Updating tunnel $tunnel configuration.");
-system("sudo ip tunnel change $tunnel local $nip");
-
-sub logger {
- my $msg = pop(@_);
- my $FACILITY = "daemon";
- my $LEVEL = "notice";
- my $TAG = "tunnel-dhclient-hook";
- my $LOGCMD = "logger -t $TAG -p $FACILITY.$LEVEL";
- system("$LOGCMD $msg");
-}
diff --git a/scripts/vyatta-update-tunnel.pl b/scripts/vyatta-update-tunnel.pl
deleted file mode 100644
index de5019ab..00000000
--- a/scripts/vyatta-update-tunnel.pl
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/perl
-
-use Getopt::Long;
-use strict;
-use lib "/opt/vyatta/share/perl5";
-use Vyatta::Config;
-
-my ($iface, $tunnel, $option);
-GetOptions("interface=s" => \$iface,
- "tunnel=s" => \$tunnel,
- "option=s" => \$option
- );
-my $FILE_DHCP_HOOK = "/etc/dhcp/dhclient-exit-hooks.d/tunnel-$tunnel";
-my $dhcp_hook = '';
-if ($option eq 'create') {
- $dhcp_hook =<<EOS;
-#!/bin/sh
-/opt/vyatta/bin/sudo-users/vyatta-tunnel-dhcp.pl --interface=\"\$interface\" --dhcp=\"$iface\" --tunnel=\"$tunnel\" --new_ip=\"\$new_ip_address\" --old_ip=\"\$old_ip_address\" --reason=\"\$reason\"
-EOS
-}
-
-open my $dhcp_hook_file, '>', $FILE_DHCP_HOOK
- or die "cannot open $FILE_DHCP_HOOK";
-print ${dhcp_hook_file} $dhcp_hook;
-close $dhcp_hook_file;
-exit 0;
-