#!/bin/sh # Leansoft Drama - open the website in a separate Chrome window that keeps downloading while the screen is locked. # Only this window uses the settings below; the user's normal Chrome profile is untouched. Safe to run again. set -eu URL='https://dramashort-downloader.leansoft-ai.com/?bg=1' PROFILE="$HOME/Library/Application Support/LeansoftDramaChrome" APP='' for name in 'Google Chrome' 'Microsoft Edge'; do if [ -d "/Applications/$name.app" ] || [ -d "$HOME/Applications/$name.app" ]; then APP="$name"; break; fi done if [ -z "$APP" ]; then echo 'Chua co Google Chrome. Cai tai https://www.google.com/chrome/ roi chay lai lenh nay.' exit 1 fi mkdir -p "$PROFILE" # caffeinate -i: the Mac stays awake (screen may still turn off and lock) until this browser window is quit. nohup caffeinate -i open -W -na "$APP" --args --user-data-dir="$PROFILE" --no-first-run --no-default-browser-check \ --disable-background-timer-throttling --disable-renderer-backgrounding --disable-backgrounding-occluded-windows \ "$URL" >/dev/null 2>&1 & echo '' echo "Da mo $APP o che do chay nen." echo 'Dang nhap, nhan batch, bam Download now. Co the dong Terminal va khoa man hinh.' echo 'Khong gap may (tru khi cam man hinh ngoai). Nen cam sac khi tai lau.'