Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
1.3 kB
1
Indexable
Never
curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g' > /tmp/waktu.txt && \
export tahun=$(cat /tmp/waktu.txt | awk '{print $4}') && \
export hari=$(cat /tmp/waktu.txt | awk '{print $2}') && \
export jam=$(cat /tmp/waktu.txt | awk '{print $5}') && \
if [[ $(cat /tmp/waktu.txt | awk '{print $3}') == Jan ]];then
	export bulan=01;
elif [[ $(cat /tmp/waktu.txt | awk '{print $3}') == Feb ]];then
	export bulan=02;
elif [[ $(cat /tmp/waktu.txt | awk '{print $3}') == Mar ]];then
	export bulan=03;
elif [[ $(cat /tmp/waktu.txt | awk '{print $3}') == Apr ]];then
	export bulan=04;
elif [[ $(cat /tmp/waktu.txt | awk '{print $3}') == May ]];then
	export bulan=05;
elif [[ $(cat /tmp/waktu.txt | awk '{print $3}') == Jun ]];then
	export bulan=06;
elif [[ $(cat /tmp/waktu.txt | awk '{print $3}') == Jul ]];then
	export bulan=07;
elif [[ $(cat /tmp/waktu.txt | awk '{print $3}') == Aug ]];then
	export bulan=08;
elif [[ $(cat /tmp/waktu.txt | awk '{print $3}') == Sep ]];then
	export bulan=09;
elif [[ $(cat /tmp/waktu.txt | awk '{print $3}') == Oct ]];then
	export bulan=10;
elif [[ $(cat /tmp/waktu.txt | awk '{print $3}') == Nov ]];then
	export bulan=11;
elif [[ $(cat /tmp/waktu.txt | awk '{print $3}') == Dec ]];then
	export bulan=12;
fi
clear && date -s ${tahun}.${bulan}.${hari}-${jam}