-
Notifications
You must be signed in to change notification settings - Fork 4
/
pacmanity_install
executable file
·41 lines (33 loc) · 1.38 KB
/
pacmanity_install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
#------------------------------------------------------------------------------
# Path - /usr/bin/pacmanity_install
# GitHub - https://github.com/The-Repo-Club/
# Author - The-Repo-Club [[email protected]]
# Start On - Sun 14 Nov 11:04:24 GMT 2021
# Modified On - Sun 14 Nov 11:04:24 GMT 2021
#------------------------------------------------------------------------------
# Keeps a list of installed packages in a Gist at your GitHub account.
if [ "$EUID" -ne 0 ]
then echo "Please run as root/sudo"
exit
fi
echo "A list of installed packages will be automatically maintained"
echo "by Pacmanity in a private Gist at your GitHub account."
echo -e "\n- Step 1: Log in to Gist using your GitHub account:"
[[ -f ~/.gist ]] || gist --login
[[ -f /etc/pacmanity ]] || touch /etc/pacmanity
mkdir -p $pkgdir/root
cp -v ~/.gist $pkgdir/root/.gist
echo -e "\n- Step 2: Save list of currently installed packages to Gist:"
GIST_URL=$(
(
pacman -Qqn
echo
pacman -Qqm
) | gist -f $HOSTNAME.pacmanity -d "$HOSTNAME: List of installed packages"
)
echo "GIST_ID=$GIST_URL" | sed 's/https:\/\/gist.github.com\///g' >> $pkgdir/etc/pacmanity
echo "An automatically mantained list of installed packages"
echo "has been successfully created in your GitHub Gist."
echo "Visit https://gist.github.com or the direct link below:"
echo "$GIST_URL"