2020-05-16 20:26:59 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-05-14 12:40:57 +00:00
|
|
|
|
2020-12-29 18:15:54 +00:00
|
|
|
function main() {
|
2020-05-14 12:40:57 +00:00
|
|
|
|
|
|
|
#print banner
|
|
|
|
banner
|
|
|
|
|
|
|
|
#read inputs
|
|
|
|
read_input
|
|
|
|
let answer=$?
|
|
|
|
|
|
|
|
case "$answer" in
|
|
|
|
|
|
|
|
1)
|
|
|
|
echo "run photoshop CC Installation..."
|
|
|
|
echo -n "using winetricks for component installation..."
|
|
|
|
run_script "scripts/PhotoshopSetup.sh" "PhotoshopSetup.sh"
|
|
|
|
;;
|
|
|
|
2)
|
|
|
|
echo -n "run adobe camera Raw installer"
|
|
|
|
run_script "scripts/cameraRawInstaller.sh" "cameraRawInstaller.sh"
|
|
|
|
;;
|
2020-12-29 18:15:54 +00:00
|
|
|
3)
|
2020-05-14 12:40:57 +00:00
|
|
|
echo "run winecfg..."
|
|
|
|
echo -n "open virtualdrive configuration..."
|
|
|
|
run_script "scripts/winecfg.sh" "winecfg.sh"
|
|
|
|
;;
|
2020-12-29 18:15:54 +00:00
|
|
|
4)
|
2020-05-14 12:40:57 +00:00
|
|
|
echo -n "uninstall photoshop CC ..."
|
|
|
|
run_script "scripts/uninstaller.sh" "uninstaller.sh"
|
|
|
|
;;
|
2020-12-29 18:15:54 +00:00
|
|
|
5)
|
2020-05-14 12:40:57 +00:00
|
|
|
echo "exit setup..."
|
|
|
|
exitScript
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
#argumaents 1=script_path 2=script_name
|
2020-12-29 18:15:54 +00:00
|
|
|
function run_script() {
|
2020-05-14 12:40:57 +00:00
|
|
|
local script_path=$1
|
|
|
|
local script_name=$2
|
|
|
|
|
|
|
|
wait_second 5
|
|
|
|
if [ -f "$script_path" ];then
|
|
|
|
echo "$script_path Found..."
|
|
|
|
chmod +x "$script_path"
|
|
|
|
else
|
|
|
|
error "$script_name not Found..."
|
|
|
|
fi
|
2020-05-16 20:46:29 +00:00
|
|
|
cd "./scripts/" && bash $script_name
|
2020-05-14 12:40:57 +00:00
|
|
|
unset script_path
|
|
|
|
}
|
|
|
|
|
2020-12-29 18:15:54 +00:00
|
|
|
function wait_second() {
|
2020-05-14 12:40:57 +00:00
|
|
|
for (( i=0 ; i<$1 ; i++ ));do
|
|
|
|
echo -n "."
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
echo ""
|
|
|
|
}
|
|
|
|
|
2020-12-29 18:15:54 +00:00
|
|
|
function read_input() {
|
2020-05-14 12:40:57 +00:00
|
|
|
while true ;do
|
|
|
|
read -p "[choose an option]$ " choose
|
2021-01-03 10:27:31 +00:00
|
|
|
if [[ "$choose" =~ (^[1-5]$) ]];then
|
2020-05-14 12:40:57 +00:00
|
|
|
break
|
|
|
|
fi
|
2021-01-03 10:27:31 +00:00
|
|
|
warning "choose a number between 1 to 5"
|
2020-05-14 12:40:57 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
return $choose
|
|
|
|
}
|
|
|
|
|
2020-12-29 18:15:54 +00:00
|
|
|
function exitScript() {
|
2020-05-14 12:40:57 +00:00
|
|
|
echo "Good Bye :)"
|
|
|
|
}
|
|
|
|
|
2020-12-29 18:15:54 +00:00
|
|
|
function banner() {
|
2020-05-14 12:40:57 +00:00
|
|
|
local banner_path="$PWD/images/banner"
|
|
|
|
if [ -f $banner_path ];then
|
|
|
|
clear && echo ""
|
|
|
|
cat $banner_path
|
|
|
|
echo ""
|
|
|
|
else
|
|
|
|
error "banner not Found..."
|
|
|
|
fi
|
|
|
|
unset banner_path
|
|
|
|
}
|
|
|
|
|
2020-12-29 18:15:54 +00:00
|
|
|
function error() {
|
2020-05-14 12:40:57 +00:00
|
|
|
echo -e "\033[1;31merror:\e[0m $@"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2020-12-29 18:15:54 +00:00
|
|
|
function warning() {
|
2020-05-14 12:40:57 +00:00
|
|
|
echo -e "\033[1;33mWarning:\e[0m $@"
|
|
|
|
}
|
|
|
|
|
|
|
|
main
|