-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathklips.sh
More file actions
executable file
·86 lines (78 loc) · 1.98 KB
/
klips.sh
File metadata and controls
executable file
·86 lines (78 loc) · 1.98 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env bash
# Check if requirements for the specific distribution are installed.
check_requirements() {
echo "Checking Requirements..."
for i in "$@"; do
if ! [ "$(command -v "$i")" ]; then
echo "$i not installed. Install it and then run the script."
exit 1
fi
done
}
check_requirements "lsb_release"
# ENV File
source ./klips.env
# Functions
# Checks OS
detect_os_installation() {
case $DISTRO in
"Arch")
echo "Arch/Arch-Based Linux Distribution Detected!"
check_requirements "paru" "flatpak" "brew" "fzf"
cd $KLIPS_DIR/scripts/arch
sh archibald.sh
;;
*)
choose_os
;;
esac
}
# Prompts the user to choose what type of distribution is in use, if it can't be categorized automatically.
choose_os() {
echo "Detected Distribution Couldn't Be Categorized. Please Choose:"
echo "What type of distro are you using?"
echo "1. Arch or Arch-Based"
echo "2. Debian or Debian-Based (No PPAs)"
echo "3. Ubuntu or Ubuntu-Based (PPAs)"
echo "4. Fedora or Fedora-Based"
echo "5. OpenSUSE or OpenSUSE-Based"
echo "6. Void or Void-Based"
echo "7. Gentoo or Gentoo-Based"
echo "8. Quit and Cancel"
read -rp "Choose: " DISTRO_CHOICE
case $DISTRO_CHOICE in
1)DISTRO="Arch";;
2)DISTRO="Debian";;
3)DISTRO="Ubuntu";;
4)DISTRO="Fedora";;
5)DISTRO="OpenSUSE";;
6)DISTRO="Void";;
7)DISTRO="Gentoo";;
8)
echo "Goodbye!"
exit
;;
*)
echo "Invalid Option!"
exit
;;
esac
echo "Restarting With Your Choice..."
detect_os_installation
}
# Execution
echo "Welcome to Kunal's Linux Post-installation Script (KLiPS)!"
echo "Detecting Linux Distribution..."
detect_os_installation
if [[ $? == 1 ]]; then
exit
elif [[ $? == 2 ]]; then
rm "$KLIPS_DIR"/install.list
exit
fi
cd $KLIPS_DIR/scripts
sh install-apps.sh ../install.list
cd $KLIPS_DIR
echo "Thank You for Using KLiPS!"
echo "If you used faced any errors or issues, please report it on our Github."
echo "If it is a security related issue, please send me a email at kunalkumarchourasiya2021@gmail.com"