Linux shell script

basic case script
this  will ask you for the restart or shutdown you linux machine
vim shut.sh
#!/bin/bash
echo "hello $USER."
echo "what you wants form me."
echo "press \"r\" to restart server"
echo "press \"s\" to shutdown the server"
echo "prss any other key to exit."
read -p "pls give your option: " t
case $t in
    r)
        reboot
    ;;
    s)
        poweroff
    ;;
    *)
        echo "invalid option."
    ;;
esac

4 comments:

  1. You can find some more detailed about echo command in linux here below :

    https://www.linuxteck.com/basic-echo-command-in-linux-with-examples/

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete

how to set time for internet use

this will allow internet access for a particular time interval. R4(config)#int f0/0 R4(config-if)#ip nat inside R4(config-...