Add Solus utility scripts for safe user removal, checking sof-bin directories, checking what provides
This commit is contained in:
parent
444e1f0fc1
commit
645fa61ba4
3 changed files with 39 additions and 0 deletions
18
solus_utility/safe_remuser.sh
Normal file
18
solus_utility/safe_remuser.sh
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
# Create a backup of a user and remove them
|
||||
# Must be run with sudo or as root
|
||||
|
||||
##Check if the user exists using getent command
|
||||
user_exists=$(getent passwd $1)
|
||||
|
||||
#If the user doesn't exist, we need not perform the backup, just exit.
|
||||
if [ -z "$user_exists" ]
|
||||
then
|
||||
echo "User '$1' does not exist"
|
||||
else
|
||||
echo "Creating backup of home dir for '$1'"
|
||||
mkdir -p "/root/deleted_users"
|
||||
tar czvf /root/deleted_users/"$1".tar.gz /home/"$1"
|
||||
userdel -rf "$1"
|
||||
echo "Removed user '$1'"
|
||||
fi
|
||||
11
solus_utility/show_sof-bin_dirs.sh
Normal file
11
solus_utility/show_sof-bin_dirs.sh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
ISODATE=$(date -I)
|
||||
get_changed_files
|
||||
|
||||
source ~/.bashrc.d/solus-monorepo-helpers.sh
|
||||
|
||||
get_changed_files ()
|
||||
{
|
||||
|
||||
}
|
||||
10
solus_utility/solus_pkg_provides_or_name.sh
Normal file
10
solus_utility/solus_pkg_provides_or_name.sh
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
pkgs="asciify autoconf automake bash-completion-devel binutils bison cmake dbus-devel diffstat diffutils expat-devel fakeroot file-devel flex flex-devel g++ gcc gfortran glibc-devel gmp-devel gobject-introspection-devel intltool libarchive-bin libffi-devel libgpg-error-devel libgudev-devel libtool-devel libxcrypt-devel libxml2-devel linux-headers m4 make meson mpc-devel mpfr-devel nano nano-syntax-highlighting nasm ncurses-devel openssl-devel pam-devel patch pkgconf polkit-devel python-devel readline-devel rootlesskit systemd-devel texinfo util-linux-devel ypkg zlib-devel"
|
||||
|
||||
for pkg in $pkgs
|
||||
do
|
||||
echo $pkg
|
||||
eopkg info $pkg | grep Provides
|
||||
echo ""
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue