From 356cf9a352125ddab35931200e8d70a114b75483 Mon Sep 17 00:00:00 2001 From: paukstelis Date: Fri, 4 Feb 2022 20:32:09 -0500 Subject: [PATCH] Remove extra scripts --- uninstall_instance.sh | 39 --------------------------------------- usbtesting.sh | 17 ----------------- 2 files changed, 56 deletions(-) delete mode 100755 uninstall_instance.sh delete mode 100755 usbtesting.sh diff --git a/uninstall_instance.sh b/uninstall_instance.sh deleted file mode 100755 index 9a07d1a..0000000 --- a/uninstall_instance.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -if (( $EUID != 0 )); then - echo "Please run as root (sudo)" - exit -fi - -if [ $SUDO_USER ]; then user=$SUDO_USER; fi -echo 'Do not remove the generic instance!' -PS3='Select instance to remove: ' -readarray -t options < <(cat /etc/octoprint_instances | sed -n -e 's/^instance:\([[:alnum:]]*\) .*/\1/p') -select opt in "${options[@]}" -do - echo "Selected instance: $opt" - break -done - -read -p "Do you want to remove everything associated with this instance?" -n 1 -r -echo #new line -if [[ $REPLY =~ ^[Yy]$ ]]; then - #disable and remove service file - if [ -f /etc/systemd/system/$opt.service ]; then - systemctl stop $opt.service - systemctl disable $opt.service - rm /etc/systemd/system/$opt.service - fi - - if [ -f /etc/systemd/system/cam_$opt.service ]; then - systemctl stop cam_$opt.service - systemctl disable cam_$opt.service - rm /etc/systemd/system/cam_$opt.service - sed -i "/cam_$opt/d" /etc/udev/rules.d/99-octoprint.rules - fi - #remove udev entry - sed -i "/$opt/d" /etc/udev/rules.d/99-octoprint.rules - #remove files - rm -rf /home/$user/.$opt - #remove from octoprint_instances - sed -i "/$opt/d" /etc/octoprint_instances -fi diff --git a/usbtesting.sh b/usbtesting.sh deleted file mode 100755 index 0f03194..0000000 --- a/usbtesting.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -journalctl --rotate > /dev/null 2>&1 -journalctl --vacuum-time=1seconds > /dev/null 2>&1 -echo "Plug your printer in via USB now (detection time-out in 1 min)" -counter=0 -while [[ -z "$UDEV" ]] && [[ $counter -lt 30 ]]; do - UDEV=$(timeout 1s journalctl -kf | sed -n -e 's/^.*SerialNumber: //p') - TEMPUSB=$(timeout 1s journalctl -kf | sed -n -e 's/^.*\(cdc_acm\|ftdi_sio\|ch341\) \([0-9].*[0-9]\): \(tty.*\|FTD.*\|ch341-uart.*\).*/\2/p') - counter=$(( $counter + 1 )) - if [ -n "$TEMPUSB" ]; then - echo $TEMPUSB - fi - if [ -n "$UDEV" ]; then - echo "Serial Number detected: $UDEV" - fi -done -