One-Touch v0.1 Script
von Anonymous- SNIPPET_TEXT:
-
- #!/bin/bash
- # One-Touch Version 0.1
- # Contact Homeless1: At this Time only over PM at debianforum.de Forum (You can write your Question in German or English)
- # Copyright (C) 2008 Homeless1
- # This program is free software;
- # you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
- # either version 3 of the License, or (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- # See the GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License along with this program;
- # if not, see <http://www.gnu.org/licenses/>.
- #########################################
- # Setting up Path to File one-touch.log and Playlist
- CHECK_PATH=/home/user
- PLAYLIST_PATH=/home/user/playlists
- ############################
- # Check if File one-touch.log exists.
- if [ "$(cat $CHECK_PATH/one-touch.log)" = "" ]; then
- echo "Create Station Checklist" # Debug Output
- echo "0" > $CHECK_PATH/one-touch.log
- exit
- fi
- ###################
- # Activate Station 0
- if [ "$(cat $CHECK_PATH/one-touch.log)" = "0" ]; then
- echo "Activate Station 0" # Debug Output
- pls-handler.sh $PLAYLIST_PATH/station-0.pls
- echo "1" > $CHECK_PATH/one-touch.log
- sleep 2
- exit
- fi
- ###################
- # Activate Station 1
- if [ "$(cat $CHECK_PATH/one-touch.log)" = "1" ]; then
- echo "Activate Station 1" # Debug Output
- pls-handler.sh $PLAYLIST_PATH/station-1.pls
- echo "2" > $CHECK_PATH/one-touch.log
- sleep 2
- exit
- fi
- ###################
- # Activate Station 2
- if [ "$(cat $CHECK_PATH/one-touch.log)" = "2" ]; then
- echo "Activate Station 2" # Debug Output
- pls-handler.sh $PLAYLIST_PATH/station-2.pls
- echo "3" > $CHECK_PATH/one-touch.log
- sleep 2
- exit
- fi
- ##############
- # Stop the MPD
- if [ "$(cat $CHECK_PATH/one-touch.log)" = "3" ]; then
- echo "Stop the Mediaplayer Daemon" # Debug Output
- mpc stop
- echo "0" > $CHECK_PATH/one-touch.log
- sleep 2
- exit
- fi
Quellcode
Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. PASTEBIN_DOWNLOAD_SNIPPET_EXPLAIN