Guest User

Untitled

a guest
Jan 19th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. # Creating the scripts directory
  2. DIR=$HOME"/scripts"
  3. if [ ! -d "$DIR" ]; then
  4. mkdir ~/scripts
  5. fi
  6.  
  7. read -p "Script name: " FILE
  8. echo "Creating script: $FILE!"
  9.  
  10. FILEPATH=$DIR"/"$FILE
  11. touch $FILEPATH
  12.  
  13. read -p "command to execute:" EXEC
  14. echo "using script:"
  15. echo $EXEC
  16.  
  17. echo "#!/bin/sh" > $FILEPATH
  18. echo $EXEC >> $FILEPATH
  19.  
  20. chmod 755 $FILEPATH
  21.  
  22. osascript -e 'tell application "System Events" to make login item at end with properties {name: "'$FILE'", path:"'$FILEPATH'", hidden:false}'
Add Comment
Please, Sign In to add comment