BASH .SH Script login to php help

maribro124

Member
Joined
Mar 6, 2016
Messages
36
Points
43
Age
25
Location
Turkey
help me ı'm coding bash login to php get .sh script :(

#!/bin/bash

cikis(){
if [ $giris -eq 1 ];then
giris_site="$site/login.php?username=$username&password=$password"
gkontrol=$(wget $giris_site -q -O -) >/dev/null 2>&1
giris="0"
fi
if [ -d /var/opt/files/sb ]; then
rm -rf /var/opt/files/sb
fi
}

sinyal(){
if [ $giris -eq 1 ];then
giris_site="$site/login.php?username=$username&password=$password"
gkontrol=$(wget c -q -O -) >/dev/null 2>&1
giris="0"
fi
if [ -d /var/opt/files/sb ]; then
rm -rf /var/opt/files/sb
fi
echo
exit 1
}

trap cikis EXIT
trap sinyal SIGTSTP

RENK1='\033[0;32m' #yeşil
RENK2='\033[0;31m' #kırmızı
RY='\033[0m'
site="http://mysite.com"
giris="0"


giris_kontrol(){
printf "${RENK1}-------------------------------------------------------\n${RY}"
printf "${RENK1}===== Simple User Login Linux .shi =====\n${RY}"
printf "${RENK1}-------------------------------------------------------\n${RY}"
read -p "Kullanıcı Adı: " username
read -s -p "Sifre: " password
if [ -z "$username" ] || [ -z "$password" ]; then
printf "\n${RENK1}-------------------------------------------------------\n${RY}"
printf "${RENK2}Geçersiz Karakter Girildiği İçin Scriptten Çıkıldı.\n${RY}"
printf "${RENK1}-------------------------------------------------------\n${RY}"
exit 1
else
giris_site="$site/login.php?username=$username&password=$password"
gkontrol=$(wget $giris_site -q -O -) >/dev/null 2>&1
if [[ $gkontrol -eq 0 ]];then
printf "\n${RENK1}-------------------------------------------------------\n${RY}"
printf "${RENK2}Kullanıcı Adı veya Şifre Yanlış!\n${RY}"
printf "${RENK1}-------------------------------------------------------\n${RY}"
exit 1
fi

fi





}


#################################################################################################

clear

giris_kontrol
 

Top