user-avatar
Today is Friday
February 10, 2012

March 25, 2010

Create Program autoshutdown sendiri bash linux

by tambang — Categories: BSD, Linux, Tutorial — Tags: , , , , , 1 Comment

:hai: emh… Kali ini saya akan melanjutkan lagi tutorial saya yang kemarin, yaitu mengenai program autoshutdown yang ada di linux :berfikir:. Hemh… penasaran dengan isi scriptnya..???:hehehe:

Oke, mari kita simak script dan step by stepnya :

  • Buat satu file bash di folder  /usr/sbin/ caranya :touch autoshutdown.sh /usr/sbin/
  • Kemudian edit isi filenya dengan editor :nano /usr/sbin/autoshutdown.sh
  • Isikan Script di bawah ini :#!/bin/bashecho -e “Hi, masukkan jam sesuai dengan keinginan kamu untuk shutdown sistem format(hh:mm) : \c “

    #echo – e digunakan untuk question inputan

    read time

    #read digunakan untuk membaca dan menyimpan hasil inputan dalam suatu variable time

    echo “Oke, Jam sudah kamu tentukan, yaitu : $time”

    que=3

    echo -n “apa anda yakin? (1=yes or 0=no) : ”

    #echo -n digunakan saat membutuhkan suatu jawaban pertanyaan pilihan

    while [ $que -eq 3 ]; do

    #array

    read que

    if [ $que -eq 1 ]; then

    shutdown -h $time

    else

    echo “thanks, by siejelex”

    fi

    done

  • Nah setelah itu ubah permissionnyachmod 755 /usr/sbin/autoshutdown.sh
  • Nah silahkan run dengan command /usr/sbin/autoshutdown.sh

1 Comment »

  1. tambang says:

    thanks all…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam Protection by WP-SpamFree

© 2012 SIEJELEX All rights reserved - Wallow theme v0.46.4 by ([][]) TwoBeers - Powered by WordPress - Have fun!