32 lines
913 B
Bash
Executable File
32 lines
913 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
source bin/helpers/func.sh
|
|
|
|
# Test for root privileges
|
|
if [ "$EUID" -ne 0 ]; then
|
|
printfe "%s\n" "red" "Please run as root"
|
|
exit 1
|
|
fi
|
|
|
|
# Remove any existing kcm installation
|
|
if [ -f "/usr/local/bin/kcm" ]; then
|
|
printfe "%s\n" "yellow" "Removing existing kcm installation..."
|
|
rm /usr/local/bin/kcm
|
|
fi
|
|
|
|
if [ -f "/usr/share/bash-completion/completions/kcm" ]; then
|
|
printfe "%s\n" "yellow" "Removing existing kcm bash completion..."
|
|
rm /usr/share/bash-completion/completions/kcm
|
|
fi
|
|
|
|
# Copy binary files to /usr/local/bin
|
|
printfe "%s\n" "cyan" "Installing kcm..."
|
|
cp $(pwd)/bin/kcm /usr/local/bin/kcm
|
|
cp $(pwd)/bin/kcm-completion.bash /usr/share/bash-completion/completions/kcm
|
|
|
|
# Copy version file to /usr/local/share/kcm/kcm.version
|
|
mkdir -p /usr/local/share/kcm
|
|
cp $(pwd)/bin/kcm.version /usr/local/share/kcm/kcm.version
|
|
|
|
printfe "%s\n" "green" "Installation complete."
|