mirror of
https://github.com/bdrtr/ServerFinder.git
synced 2025-11-08 18:52:47 +00:00
closed-beta
This commit is contained in:
parent
ec160f7ed9
commit
3a2e7674b6
33
install.sh
Executable file
33
install.sh
Executable file
@ -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
|
||||||
9
main.sh
Normal file → Executable file
9
main.sh
Normal file → Executable file
@ -1,8 +1,10 @@
|
|||||||
#! usr/bin/bash
|
#!/usr/bin/bash
|
||||||
|
|
||||||
source finder.sh
|
source finder.sh
|
||||||
source starter.sh
|
source starter.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
|
|
||||||
result=$(find_server_files)
|
result=$(find_server_files)
|
||||||
@ -12,4 +14,7 @@ function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user