#!/bin/bash
PS1="\e]2;melakukan shutdown\a\u@\h:\$ "
setterm -term linux -back green -fore yellow -clear
function count{
local OLD_IFS="${IFS}"
IFS=":"
local ARR=( $1 )
local SECONDS=$(( (ARR[0] * 60 * 60) + (ARR[1] * 60) + ARR[2] ))
local START=$(date +%s)
local END=$((START + SECONDS))
local CUR=$START
while [[ $CUR -lt $END ]]
do
CUR=$(date +%s)
LEFT=$((END-CUR))
printf "\r%02d:%02d:%02d" \
$((LEFT/3600)) $(( (LEFT/60)%60)) $((LEFT%60))
sleep 1
done
IFS="${OLD_IFS}"
echo " "
}
count "00:00:21"
sudo init 0 #untuk linux mint
#kalo archlinux systemctl poweroff -i dan hapus sudo init 0
$@
/bin/bash
copy kan script yang kita simpan contoh tewas
cp tewas /usr/local/bin
kemudian run dengan mengetikkan perintah tewas
PS1="\e]2;melakukan shutdown\a\u@\h:\$ "
setterm -term linux -back green -fore yellow -clear
function count{
local OLD_IFS="${IFS}"
IFS=":"
local ARR=( $1 )
local SECONDS=$(( (ARR[0] * 60 * 60) + (ARR[1] * 60) + ARR[2] ))
local START=$(date +%s)
local END=$((START + SECONDS))
local CUR=$START
while [[ $CUR -lt $END ]]
do
CUR=$(date +%s)
LEFT=$((END-CUR))
printf "\r%02d:%02d:%02d" \
$((LEFT/3600)) $(( (LEFT/60)%60)) $((LEFT%60))
sleep 1
done
IFS="${OLD_IFS}"
echo " "
}
count "00:00:21"
sudo init 0 #untuk linux mint
#kalo archlinux systemctl poweroff -i dan hapus sudo init 0
$@
/bin/bash
copy kan script yang kita simpan contoh tewas
cp tewas /usr/local/bin
kemudian run dengan mengetikkan perintah tewas