diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..eb7f28a --- /dev/null +++ b/install.sh @@ -0,0 +1,33 @@ +#!/bin/bash +function setup() { + + + SOURCE_DIR="$(dirname "$(realpath "$0")")" + INSTALL_DIR="/usr/local/bin/$(basename "$SOURCE_DIR")" + + echo $SOURCE_DIR + echo $INSTALL_DIR + + ALIAS_NAME="allay" #the name + MAIN_SCRIPT="main.sh" #the script + SUB_FILES=$(for file in $(ls $SOURCE_DIR); do echo $file; done | grep -v $SCRIPT_NAME) #the sub files + + echo "setting up..." + + sudo mkdir -p $INSTALL_DIR + + sudo cp -r "$SOURCE_DIR"/* "$INSTALL_DIR" + sudo chmod +x "$INSTALL_DIR/$MAIN_SCRIPT" + + echo "alias $ALIAS_NAME=\"$INSTALL_DIR/$MAIN_SCRIPT\"" >> ~/.bashrc + source ~/.bashrc + + + echo "Kurulum tamamlandı! Artık '$ALIAS_NAME' komutunu her yerden çalıştırabilirsiniz." + echo "yetki veriliyor..." + sudo chmod +777 /usr/local/bin/ServerFinder/* + echo "yetki verildi!" + +} + +setup \ No newline at end of file diff --git a/main.sh b/main.sh old mode 100644 new mode 100755 index 5783f80..60470bc --- a/main.sh +++ b/main.sh @@ -1,8 +1,10 @@ -#! usr/bin/bash +#!/usr/bin/bash source finder.sh source starter.sh + + function main() { result=$(find_server_files) @@ -12,4 +14,7 @@ function main() { } -main \ No newline at end of file +main + + +