Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %post
- import()
- {
- echo "Do you want to import file?"
- select INPUT in "Y" "N"; do
- case $INPUT in
- Y ) echo "You selected to import file";break;;
- N ) echo "Exiting";exit 0;break;;
- esac
- done
- read -p "Please file path: " FILE
- if [ -d "$FILE" ]; then
- cp $FILE/myFile /opt/tmp/
- echo "Done!"
- else
- echo "No File Path."
- done=0
- while [ $done = 0 ]
- do
- echo "Do you want to abort"
- select INPUT in "Y" "N";
- do
- case $INPUT in
- Y )
- echo "Aborting"
- done=1
- break
- ;;
- N )
- echo "You selected to import"
- # break
- #;;
- read -p "Please provide the directory : " FILE
- if [ -d "$FILE" ]; then
- cp $FILE/myFile /opt/tmp
- echo "Done"
- done=1
- else
- echo "Aborting."
- fi
- break
- ;;
- esac
- done
- done
- fi
- }
- import
- exit 0
- if ! exec </dev/tty; then
- : "deal with the case where you simply can't read from the user here"
- exit
- fi
- # ...the read command will work here.
- mount -t cifs //1.2.3.4/share /var/www/html -o username=user
- Password:
- echo "Do you want to install <some package> [Y/n] "
- if exec </dev/tty; then
- read input;
- fi
- # use input here or below
- echo "Do you want to install <some package> [Y/n] " >/dev/tty
- if exec </dev/tty; then
- read input;
- fi
- # use input here or below
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement