diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..644bb33 --- /dev/null +++ b/install.sh @@ -0,0 +1,40 @@ +#!/bin/bash +#gTock script installer. + +if [ "$(whoami)" != "root" ]; then + exec sudo $0 +fi + +prompt_yes_no() { + while true; do + read -p "$1 (yes/no): " answer + case $answer in + [Yy]* ) return 0;; + [Nn]* ) return 1;; + * ) echo "Please answer yes or no.";; + esac + done +} + + +if prompt_yes_no "This installer will install gTock. Do you want to proceed?"; then + echo "Installing gTock...." +else + echo "Installation cancelled" + exit 1 +fi + + +script_dir=$(realpath $(dirname "$0")) + +if [ ! -d $script_dir/gtock-src ]; then + echo "gtock source files was missing" + exit 1 +fi + +cp -rf $script_dir/gtock-src/* / + +glib-compile-schemas /usr/share/glib-2.0/schemas/ + +echo "gTock installation complete! +