From b520c4454af780270e4eddf99ade64f2ad76fabd Mon Sep 17 00:00:00 2001 From: Fourdee Date: Sat, 9 May 2015 10:01:53 +0100 Subject: [PATCH 01/14] v54 Version codes --- dietpi/.version | 2 +- dietpi/finalise | 2 +- dietpi/server_version | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/.version b/dietpi/.version index 59343b09ec..fb1e7bc869 100644 --- a/dietpi/.version +++ b/dietpi/.version @@ -1 +1 @@ -53 +54 diff --git a/dietpi/finalise b/dietpi/finalise index c62767e05c..9437b41af4 100644 --- a/dietpi/finalise +++ b/dietpi/finalise @@ -155,7 +155,7 @@ #//////////////////////////////////// #SET DIETPI VERSION CODE - echo 53 > /boot/dietpi/.version + echo 54 > /boot/dietpi/.version #.auto_boot_index Console echo 0 > /boot/dietpi/.auto_boot_index diff --git a/dietpi/server_version b/dietpi/server_version index 3d43fa6d44..2db540b137 100644 --- a/dietpi/server_version +++ b/dietpi/server_version @@ -1,2 +1,2 @@ -53 +54 3 From d680a31115eb7e3017aa2d226044e7282f65f6b6 Mon Sep 17 00:00:00 2001 From: Fourdee Date: Sat, 9 May 2015 13:51:07 +0100 Subject: [PATCH 02/14] v54 Initial support for RPI Camera Web (raspimjpeg) --- dietpi/boot | 4 +- dietpi/conf/raspimjpeg | 117 ++++++++++++++++++++++++++++++++++++ dietpi/conf/raspimjpeg_init | 45 ++++++++++++++ dietpi/dietpi-services | 3 + dietpi/dietpi-software | 3 +- dietpi/patch_file | 3 + 6 files changed, 171 insertions(+), 4 deletions(-) create mode 100644 dietpi/conf/raspimjpeg create mode 100644 dietpi/conf/raspimjpeg_init diff --git a/dietpi/boot b/dietpi/boot index c018fd41ab..11c722346d 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -162,7 +162,7 @@ # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - #Apply DietPi CPU (Governer) Settings + #Apply DietPi CPU Governor and settings /boot/dietpi/dietpi-cpu_set #Disable RPi hdmi output if set in dietpi.txt @@ -215,7 +215,7 @@ dphys-swapfile setup dphys-swapfile swapon - #Activate DietPi Boot Loader User Settings /dietpi.txt + #Activate DietPi Boot Loader User Settings and bring up network (dietpi.txt) DietPi_Bootloader_Settings #start all services diff --git a/dietpi/conf/raspimjpeg b/dietpi/conf/raspimjpeg new file mode 100644 index 0000000000..ce758d4f20 --- /dev/null +++ b/dietpi/conf/raspimjpeg @@ -0,0 +1,117 @@ +################################ +# Config File for raspimjpeg # +################################ +# Syntax: "Command Param", no spaces before/after line allowed + +# +# Camera Options +# +# annotation max length: 31 characters +annotation RPi Cam %Y.%M.%D_%h:%m:%s +anno_background false +anno3_custom_background_colour 0 +anno3_custom_background_Y 0 +anno3_custom_background_U 128 +anno3_custom_background_V 128 +anno3_custom_text_colour 0 +anno3_custom_text_Y 255 +anno3_custom_text_U 128 +anno3_custom_text_V 128 +anno_text_size 50 + +sharpness 0 +contrast 0 +brightness 50 +saturation 0 +iso 0 +metering_mode average +video_stabilisation false +exposure_compensation 0 +exposure_mode auto +white_balance auto +image_effect none +colour_effect_en false +colour_effect_u 128 +colour_effect_v 128 +rotation 0 +hflip false +vflip false +sensor_region_x 0 +sensor_region_y 0 +sensor_region_w 65536 +sensor_region_h 65536 +shutter_speed 0 +raw_layer false + +# +# Preview Options +# +# fps_preview = video_fps (below) / divider +# +width 512 +quality 25 +divider 1 + +# +# Video Options +# +video_width 1920 +video_height 1080 +video_fps 25 +video_bitrate 17000000 +video_buffer 0 + +#MP4Box false=leave as raw h264, background=box in background +MP4Box background +MP4Box_fps 25 + +# +# Image Options +# +image_width 2592 +image_height 1944 +image_quality 85 + +#time lapse interval 0.1 sec units +tl_interval 30 + +# +# File Locations +# +# preview path: add %d for number +# image+video path: add %d for number, year, month, day, hour, minute, second +# +preview_path /dev/shm/mjpeg/cam.jpg +image_path /var/www/media/im_%i_%Y%M%D_%h%m%s.jpg +lapse_path /var/www/media/tl_%i_%t_%Y%M%D_%h%m%s.jpg +video_path /var/www/media/vi_%v_%Y%M%D_%h%m%s.mp4 +status_file /var/www/status_mjpeg.txt +control_file /var/www/FIFO +media_path /var/www/media +macros_path /var/www/macros +subdir_char @ + +# thumb generator control +# Set v, i, or t in string to enable thumbs for images, videos, or lapse +thumb_gen vit + +# +# Autostart +# +# autostart: standard/idle +# motion detection can only be true if autostart is standard +# +autostart standard +motion_detection false + +# Watchdog +# Interval in 0.1 secs +# Errors is Number of times cam.jpg doesn't change before exit +watchdog_interval 30 +watchdog_errors 3 + +#optional user_config file to overwrite (persist) changes +user_config /var/www/uconfig + +#logfile for raspimjpeg, default to merge with scheduler log +log_file /var/www/scheduleLog.txt diff --git a/dietpi/conf/raspimjpeg_init b/dietpi/conf/raspimjpeg_init new file mode 100644 index 0000000000..79deae3613 --- /dev/null +++ b/dietpi/conf/raspimjpeg_init @@ -0,0 +1,45 @@ +#!/bin/bash +{ + #//////////////////////////////////// + # DietPi Raspimjpeg control Script + # + #//////////////////////////////////// + # Created by Dan Knight / daniel_haze@hotmail.com / fuzon.co.uk + # + # Info: + # - Location /etc/raspimjpeg_init + # - Allows service control for Raspimjpeg and PHP schedule, used by RPI Camera Web + # - Called from /boot/dietpi/dietpi-services + # + #//////////////////////////////////// + + INPUT=$1 + + Raspimjeg_Stop(){ + killall raspimjpeg &> /dev/null + killall php &> /dev/null + } + + Raspimjeg_Start(){ + mkdir -p /dev/shm/mjpeg + chown www-data:www-data /dev/shm/mjpeg + chmod 777 /dev/shm/mjpeg + + sleep 1 + su -c 'raspimjpeg > /dev/null &' www-data + + sleep 1 + su -c 'php /var/www/schedule.php > /dev/null &' www-data + } + + if [ "$1" = "stop" ] || [ "$1" = "restart" ]; then + Raspimjeg_Stop + fi + + if [ "$1" = "start" ] || [ "$1" = "restart" ]; then + Raspimjeg_Start + fi + + exit + +} \ No newline at end of file diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 3ba573c372..1ee43d64ff 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -32,6 +32,9 @@ service minidlna $1 &> /dev/null service noip2 $1 &> /dev/null service vpnserver $1 &> /dev/null + + #Non-service based control for specific software + /etc/raspimjpeg_init $1 &> /dev/null echo -e " Completed" echo -e "" diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1d101a273a..f54466be61 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -231,7 +231,7 @@ INSTALL_DESCRIPTION='Apache2 / Mysql / (php5) / phpmyadmin' Banner_Installing - apt-get install php5 -y + apt-get install php5 libapache2-mod-php5 -y #Debian - php-apc if (( $DISTRO == 1 )); then @@ -244,7 +244,6 @@ INSTALL_DESCRIPTION='Apache2 / Mysql / php5 / (phpmyadmin)' Banner_Installing apt-get install phpmyadmin -y - apt-get install libapache2-mod-php5 -y #Forums PHPBB if (( $PHPBB == 1 )); then diff --git a/dietpi/patch_file b/dietpi/patch_file index 7436e8d0fe..175490219f 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -85,6 +85,9 @@ chmod +x /usr/local/games/opentyrian/run fi + elif (( $VERSION_CURRENT == 53 )); then + echo -e "53 > 54 patch" + fi sleep 2 From 05206dbaaeead977a2a6394cd25aff289b304f09 Mon Sep 17 00:00:00 2001 From: Fourdee Date: Sun, 10 May 2015 05:42:07 +0100 Subject: [PATCH 03/14] v54 Added changelog. RPI cam web motion conf. Change_hostname is now a global function script /func/ Better explination of swapfile in dietpi-config --- CHANGELOG.txt | 40 +++ dietpi/conf/motion.conf | 637 ++++++++++++++++++++++++++++++++++++ dietpi/dietpi-config | 13 +- dietpi/func/change_hostname | 34 ++ 4 files changed, 717 insertions(+), 7 deletions(-) create mode 100644 CHANGELOG.txt create mode 100644 dietpi/conf/motion.conf create mode 100644 dietpi/func/change_hostname diff --git a/CHANGELOG.txt b/CHANGELOG.txt new file mode 100644 index 0000000000..154562a315 --- /dev/null +++ b/CHANGELOG.txt @@ -0,0 +1,40 @@ +v53 +(09/05/15) +EOL corrections in conf folder, resolves startup issues with YMPD/Softether/Opentyrian). +New func folder for global functions. (allows us to use re-occuring code in dietpi scripts) +dietpi-config > display > GPU mem split for RPI is now based on an array (optimized/cleaned coding) + +----------------------------------------------------------------------------------------------------------- + +v52 +(07/05/15) +DietPi-Software | Modifications to help improve initial user experience. +DietPi-Config > Display Options | Added support for RPi Camera. Enable/disable camera and led. +DietPi General | Fix for dumb or unset TERM provided by tdaitx. Allows for SCP connections with OpenSSH Server installed. +DietPi General | Added time-outs and retry limits when checking urls to prevent endless waiting (internet tests/apt repo checks etc). +DietPi-Software > Desktop (LXDE) | Trashcan is now disabled. This allows DietPi to save resources by not needing gvfs packages. + +----------------------------------------------------------------------------------------------------------- + +v51 +(05/05/15) +Disable PCmanFM trashcan (allows us to not require gvfs packages) + +----------------------------------------------------------------------------------------------------------- + +v50 +(04/05/15) +DietPi-Software > Desktop (LXDE) +- Optimized/reduced installation time, now takes 4 minutes on a Pi2 (previously 20+ minutes). +- Optimized/reduced installed filesystem usage, now 200MB (previously 500MB+) +- Optimized/reduced number of processes running, now 26 (Previously 55+) +- DietPi's LXpanel config now gets correctly applied. + +DietPi-Update +- Optimized. No longer requires 20MB+ Git to be installed. Uses wget and unzip, both under 1MB. +- Automatically checks and updates DietPi on 1st run. + +DietPi-Config | New menu Audio Options. +- RPi Audiophiles rejoice! Added support for external soundcards (Supported cards: HifiBerry DAC/DAC+ Digi/Digi+ Amp/Amp+ , https://www.hifiberry.com/). + +----------------------------------------------------------------------------------------------------------- diff --git a/dietpi/conf/motion.conf b/dietpi/conf/motion.conf new file mode 100644 index 0000000000..469a74841f --- /dev/null +++ b/dietpi/conf/motion.conf @@ -0,0 +1,637 @@ +# Rename this distribution example file to motion.conf +# +# This config file was generated by motion 3.2.12 + + +############################################################ +# Daemon +############################################################ + +# Start in daemon (background) mode and release terminal (default: off) +daemon on + +# File to store the process ID, also called pid file. (default: not defined) +; process_id_file /var/run/motion/motion.pid + +############################################################ +# Basic Setup Mode +############################################################ + +# Start in Setup-Mode, daemon disabled. (default: off) +setup_mode off + +########################################################### +# Capture device options +############################################################ + +# Videodevice to be used for capturing (default /dev/video0) +# for FreeBSD default is /dev/bktr0 +; videodevice /dev/video0 + +# v4l2_palette allows to choose preferable palette to be use by motion +# to capture from those supported by your videodevice. (default: 8) +# E.g. if your videodevice supports both V4L2_PIX_FMT_SBGGR8 and +# V4L2_PIX_FMT_MJPEG then motion will by default use V4L2_PIX_FMT_MJPEG. +# Setting v4l2_palette to 1 forces motion to use V4L2_PIX_FMT_SBGGR8 +# instead. +# +# Values : +# V4L2_PIX_FMT_SN9C10X : 0 'S910' +# V4L2_PIX_FMT_SBGGR8 : 1 'BA81' +# V4L2_PIX_FMT_MJPEG : 2 'MJPEG' +# V4L2_PIX_FMT_JPEG : 3 'JPEG' +# V4L2_PIX_FMT_RGB24 : 4 'RGB3' +# V4L2_PIX_FMT_UYVY : 5 'UYVY' +# V4L2_PIX_FMT_YUYV : 6 'YUYV' +# V4L2_PIX_FMT_YUV422P : 7 '422P' +# V4L2_PIX_FMT_YUV420 : 8 'YU12' +v4l2_palette 8 + +# Tuner device to be used for capturing using tuner as source (default /dev/tuner0) +# This is ONLY used for FreeBSD. Leave it commented out for Linux +; tunerdevice /dev/tuner0 + +# The video input to be used (default: 8) +# Should normally be set to 0 or 1 for video/TV cards, and 8 for USB cameras +input 8 + +# The video norm to use (only for video capture and TV tuner cards) +# Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL) +norm 0 + +# The frequency to set the tuner to (kHz) (only for TV tuner cards) (default: 0) +frequency 0 + +# Rotate image this number of degrees. The rotation affects all saved images as +# well as mpeg movies. Valid values: 0 (default = no rotation), 90, 180 and 270. +rotate 0 + +# Image width (pixels). Valid range: Camera dependent, default: 352 +width 352 + +# Image height (pixels). Valid range: Camera dependent, default: 288 +height 288 + +# Maximum number of frames to be captured per second. +# Valid range: 2-100. Default: 100 (almost no limit). +framerate 2 + +# Minimum time in seconds between capturing picture frames from the camera. +# Default: 0 = disabled - the capture rate is given by the camera framerate. +# This option is used when you want to capture images at a rate lower than 2 per second. +minimum_frame_time 0 + +# URL to use if you are using a network camera, size will be autodetected (incl http:// ftp:// or file:///) +# Must be a URL that returns single jpeg pictures or a raw mjpeg stream. Default: Not defined +netcam_url http://localhost/cam_pic.php + +# Username and password for network camera (only if required). Default: not defined +# Syntax is user:password +; netcam_userpass value + +# The setting for keep-alive of network socket, should improve performance on compatible net cameras. +# 1.0: The historical implementation using HTTP/1.0, closing the socket after each http request. +# keep_alive: Use HTTP/1.0 requests with keep alive header to reuse the same connection. +# 1.1: Use HTTP/1.1 requests that support keep alive as default. +# Default: 1.0 +; netcam_http 1.0 + +# URL to use for a netcam proxy server, if required, e.g. "http://myproxy". +# If a port number other than 80 is needed, use "http://myproxy:1234". +# Default: not defined +; netcam_proxy value + +# Set less strict jpeg checks for network cameras with a poor/buggy firmware. +# Default: off +netcam_tolerant_check off + +# Let motion regulate the brightness of a video device (default: off). +# The auto_brightness feature uses the brightness option as its target value. +# If brightness is zero auto_brightness will adjust to average brightness value 128. +# Only recommended for cameras without auto brightness +auto_brightness off + +# Set the initial brightness of a video device. +# If auto_brightness is enabled, this value defines the average brightness level +# which Motion will try and adjust to. +# Valid range 0-255, default 0 = disabled +brightness 0 + +# Set the contrast of a video device. +# Valid range 0-255, default 0 = disabled +contrast 0 + +# Set the saturation of a video device. +# Valid range 0-255, default 0 = disabled +saturation 0 + +# Set the hue of a video device (NTSC feature). +# Valid range 0-255, default 0 = disabled +hue 0 + + +############################################################ +# Round Robin (multiple inputs on same video device name) +############################################################ + +# Number of frames to capture in each roundrobin step (default: 1) +roundrobin_frames 1 + +# Number of frames to skip before each roundrobin step (default: 1) +roundrobin_skip 1 + +# Try to filter out noise generated by roundrobin (default: off) +switchfilter off + + +############################################################ +# Motion Detection Settings: +############################################################ + +# Threshold for number of changed pixels in an image that +# triggers motion detection (default: 1500) +threshold 1500 + +# Automatically tune the threshold down if possible (default: off) +threshold_tune off + +# Noise threshold for the motion detection (default: 32) +noise_level 32 + +# Automatically tune the noise threshold (default: on) +noise_tune on + +# Despeckle motion image using (e)rode or (d)ilate or (l)abel (Default: not defined) +# Recommended value is EedDl. Any combination (and number of) of E, e, d, and D is valid. +# (l)abeling must only be used once and the 'l' must be the last letter. +# Comment out to disable +despeckle EedDl + +# Detect motion in predefined areas (1 - 9). Areas are numbered like that: 1 2 3 +# A script (on_area_detected) is started immediately when motion is 4 5 6 +# detected in one of the given areas, but only once during an event. 7 8 9 +# One or more areas can be specified with this option. (Default: not defined) +; area_detect value + +# PGM file to use as a sensitivity mask. +# Full path name to. (Default: not defined) +; mask_file value + +# Dynamically create a mask file during operation (default: 0) +# Adjust speed of mask changes from 0 (off) to 10 (fast) +smart_mask_speed 0 + +# Ignore sudden massive light intensity changes given as a percentage of the picture +# area that changed intensity. Valid range: 0 - 100 , default: 0 = disabled +lightswitch 0 + +# Picture frames must contain motion at least the specified number of frames +# in a row before they are detected as true motion. At the default of 1, all +# motion is detected. Valid range: 1 to thousands, recommended 1-5 +minimum_motion_frames 1 + +# Specifies the number of pre-captured (buffered) pictures from before motion +# was detected that will be output at motion detection. +# Recommended range: 0 to 5 (default: 0) +# Do not use large values! Large values will cause Motion to skip video frames and +# cause unsmooth mpegs. To smooth mpegs use larger values of post_capture instead. +pre_capture 0 + +# Number of frames to capture after motion is no longer detected (default: 0) +post_capture 0 + +# Gap is the seconds of no motion detection that triggers the end of an event +# An event is defined as a series of motion images taken within a short timeframe. +# Recommended value is 60 seconds (Default). The value 0 is allowed and disables +# events causing all Motion to be written to one single mpeg file and no pre_capture. +gap 3 + +# Maximum length in seconds of an mpeg movie +# When value is exceeded a new mpeg file is created. (Default: 0 = infinite) +max_mpeg_time 0 + +# Always save images even if there was no motion (default: off) +output_all off + + +############################################################ +# Image File Output +############################################################ + +# Output 'normal' pictures when motion is detected (default: on) +# Valid values: on, off, first, best, center +# When set to 'first', only the first picture of an event is saved. +# Picture with most motion of an event is saved when set to 'best'. +# Picture with motion nearest center of picture is saved when set to 'center'. +# Can be used as preview shot for the corresponding movie. +output_normal off + +# Output pictures with only the pixels moving object (ghost images) (default: off) +output_motion off + +# The quality (in percent) to be used by the jpeg compression (default: 75) +quality 75 + +# Output ppm images instead of jpeg (default: off) +ppm off + + +############################################################ +# FFMPEG related options +# Film (mpeg) file output, and deinterlacing of the video input +# The options movie_filename and timelapse_filename are also used +# by the ffmpeg feature +############################################################ + +# Use ffmpeg to encode mpeg movies in realtime (default: off) +ffmpeg_cap_new off + +# Use ffmpeg to make movies with only the pixels moving +# object (ghost images) (default: off) +ffmpeg_cap_motion off + +# Use ffmpeg to encode a timelapse movie +# Default value 0 = off - else save frame every Nth second +ffmpeg_timelapse 0 + +# The file rollover mode of the timelapse video +# Valid values: hourly, daily (default), weekly-sunday, weekly-monday, monthly, manual +ffmpeg_timelapse_mode daily + +# Bitrate to be used by the ffmpeg encoder (default: 400000) +# This option is ignored if ffmpeg_variable_bitrate is not 0 (disabled) +ffmpeg_bps 500000 + +# Enables and defines variable bitrate for the ffmpeg encoder. +# ffmpeg_bps is ignored if variable bitrate is enabled. +# Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps, +# or the range 2 - 31 where 2 means best quality and 31 is worst. +ffmpeg_variable_bitrate 0 + +# Codec to used by ffmpeg for the video compression. +# Timelapse mpegs are always made in mpeg1 format independent from this option. +# Supported formats are: mpeg1 (ffmpeg-0.4.8 only), mpeg4 (default), and msmpeg4. +# mpeg1 - gives you files with extension .mpg +# mpeg4 or msmpeg4 - gives you files with extension .avi +# msmpeg4 is recommended for use with Windows Media Player because +# it requires no installation of codec on the Windows client. +# swf - gives you a flash film with extension .swf +# flv - gives you a flash video with extension .flv +# ffv1 - FF video codec 1 for Lossless Encoding ( experimental ) +# mov - QuickTime ( testing ) +ffmpeg_video_codec swf + +# Use ffmpeg to deinterlace video. Necessary if you use an analog camera +# and see horizontal combing on moving objects in video or pictures. +# (default: off) +ffmpeg_deinterlace off + + +############################################################ +# Snapshots (Traditional Periodic Webcam File Output) +############################################################ + +# Make automated snapshot every N seconds (default: 0 = disabled) +snapshot_interval 0 + + +############################################################ +# Text Display +# %Y = year, %m = month, %d = date, +# %H = hour, %M = minute, %S = second, %T = HH:MM:SS, +# %v = event, %q = frame number, %t = thread (camera) number, +# %D = changed pixels, %N = noise level, \n = new line, +# %i and %J = width and height of motion area, +# %K and %L = X and Y coordinates of motion center +# %C = value defined by text_event - do not use with text_event! +# You can put quotation marks around the text to allow +# leading spaces +############################################################ + +# Locate and draw a box around the moving object. +# Valid values: on, off and preview (default: off) +# Set to 'preview' will only draw a box in preview_shot pictures. +locate off + +# Draws the timestamp using same options as C function strftime(3) +# Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock +# Text is placed in lower right corner +text_right %Y-%m-%d\n%T-%q + +# Draw a user defined text on the images using same options as C function strftime(3) +# Default: Not defined = no text +# Text is placed in lower left corner +; text_left CAMERA %t + +# Draw the number of changed pixed on the images (default: off) +# Will normally be set to off except when you setup and adjust the motion settings +# Text is placed in upper right corner +text_changes off + +# This option defines the value of the special event conversion specifier %C +# You can use any conversion specifier in this option except %C. Date and time +# values are from the timestamp of the first image in the current event. +# Default: %Y%m%d%H%M%S +# The idea is that %C can be used filenames and text_left/right for creating +# a unique identifier for each event. +text_event %Y%m%d%H%M%S + +# Draw characters at twice normal size on images. (default: off) +text_double off + + +############################################################ +# Target Directories and filenames For Images And Films +# For the options snapshot_, jpeg_, mpeg_ and timelapse_filename +# you can use conversion specifiers +# %Y = year, %m = month, %d = date, +# %H = hour, %M = minute, %S = second, +# %v = event, %q = frame number, %t = thread (camera) number, +# %D = changed pixels, %N = noise level, +# %i and %J = width and height of motion area, +# %K and %L = X and Y coordinates of motion center +# %C = value defined by text_event +# Quotation marks round string are allowed. +############################################################ + +# Target base directory for pictures and films +# Recommended to use absolute path. (Default: current working directory) +target_dir /var/www/media + +# File path for snapshots (jpeg or ppm) relative to target_dir +# Default: %v-%Y%m%d%H%M%S-snapshot +# Default value is equivalent to legacy oldlayout option +# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-snapshot +# File extension .jpg or .ppm is automatically added so do not include this. +# Note: A symbolic link called lastsnap.jpg created in the target_dir will always +# point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap' +snapshot_filename %v-%Y%m%d%H%M%S-snapshot + +# File path for motion triggered images (jpeg or ppm) relative to target_dir +# Default: %v-%Y%m%d%H%M%S-%q +# Default value is equivalent to legacy oldlayout option +# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-%q +# File extension .jpg or .ppm is automatically added so do not include this +# Set to 'preview' together with best-preview feature enables special naming +# convention for preview shots. See motion guide for details +jpeg_filename vthumb_%Y%m%d_%H%M%S + +# File path for motion triggered ffmpeg films (mpeg) relative to target_dir +# Default: %v-%Y%m%d%H%M%S +# Default value is equivalent to legacy oldlayout option +# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H%M%S +# File extension .mpg or .avi is automatically added so do not include this +# This option was previously called ffmpeg_filename +movie_filename %v-%Y%m%d%H%M%S + +# File path for timelapse mpegs relative to target_dir +# Default: %Y%m%d-timelapse +# Default value is near equivalent to legacy oldlayout option +# For Motion 3.0 compatible mode choose: %Y/%m/%d-timelapse +# File extension .mpg is automatically added so do not include this +timelapse_filename %Y%m%d-timelapse + + +############################################################ +# Live Webcam Server +############################################################ + +# The mini-http server listens to this port for requests (default: 0 = disabled) +webcam_port 0 + +# Quality of the jpeg (in percent) images produced (default: 50) +webcam_quality 50 + +# Output frames at 1 fps when no motion is detected and increase to the +# rate given by webcam_maxrate when motion is detected (default: off) +webcam_motion off + +# Maximum framerate for webcam streams (default: 1) +webcam_maxrate 1 + +# Restrict webcam connections to localhost only (default: on) +webcam_localhost on + +# Limits the number of images per connection (default: 0 = unlimited) +# Number can be defined by multiplying actual webcam rate by desired number of seconds +# Actual webcam rate is the smallest of the numbers framerate and webcam_maxrate +webcam_limit 0 + + +############################################################ +# HTTP Based Control +############################################################ + +# TCP/IP port for the http server to listen on (default: 0 = disabled) +control_port 6642 + +# Restrict control connections to localhost only (default: on) +control_localhost on + +# Output for http server, select off to choose raw text plain (default: on) +control_html_output off + +# Authentication for the http based control. Syntax username:password +# Default: not defined (Disabled) +; control_authentication username:password + + +############################################################ +# Tracking (Pan/Tilt) +############################################################ + +# Type of tracker (0=none (default), 1=stepper, 2=iomojo, 3=pwc, 4=generic, 5=uvcvideo) +# The generic type enables the definition of motion center and motion size to +# be used with the conversion specifiers for options like on_motion_detected +track_type 0 + +# Enable auto tracking (default: off) +track_auto off + +# Serial port of motor (default: none) +; track_port value + +# Motor number for x-axis (default: 0) +track_motorx 0 + +# Motor number for y-axis (default: 0) +track_motory 0 + +# Maximum value on x-axis (default: 0) +track_maxx 0 + +# Maximum value on y-axis (default: 0) +track_maxy 0 + +# ID of an iomojo camera if used (default: 0) +track_iomojo_id 0 + +# Angle in degrees the camera moves per step on the X-axis +# with auto-track (default: 10) +# Currently only used with pwc type cameras +track_step_angle_x 10 + +# Angle in degrees the camera moves per step on the Y-axis +# with auto-track (default: 10) +# Currently only used with pwc type cameras +track_step_angle_y 10 + +# Delay to wait for after tracking movement as number +# of picture frames (default: 10) +track_move_wait 10 + +# Speed to set the motor to (stepper motor option) (default: 255) +track_speed 255 + +# Number of steps to make (stepper motor option) (default: 40) +track_stepsize 40 + + +############################################################ +# External Commands, Warnings and Logging: +# You can use conversion specifiers for the on_xxxx commands +# %Y = year, %m = month, %d = date, +# %H = hour, %M = minute, %S = second, +# %v = event, %q = frame number, %t = thread (camera) number, +# %D = changed pixels, %N = noise level, +# %i and %J = width and height of motion area, +# %K and %L = X and Y coordinates of motion center +# %C = value defined by text_event +# %f = filename with full path +# %n = number indicating filetype +# Both %f and %n are only defined for on_picture_save, +# on_movie_start and on_movie_end +# Quotation marks round string are allowed. +############################################################ + +# Do not sound beeps when detecting motion (default: on) +# Note: Motion never beeps when running in daemon mode. +quiet on + +# Command to be executed when an event starts. (default: none) +# An event starts at first motion detected after a period of no motion defined by gap +on_event_start echo -n '1' > /var/www/FIFO1 + +# Command to be executed when an event ends after a period of no motion +# (default: none). The period of no motion is defined by option gap. +on_event_end echo -n '0' > /var/www/FIFO1 + +# Command to be executed when a picture (.ppm|.jpg) is saved (default: none) +# To give the filename as an argument to a command append it with %f +; on_picture_save value + +# Command to be executed when a motion frame is detected (default: none) +; on_motion_detected value + +# Command to be executed when motion in a predefined area is detected +# Check option 'area_detect'. (default: none) +; on_area_detected value + +# Command to be executed when a movie file (.mpg|.avi) is created. (default: none) +# To give the filename as an argument to a command append it with %f +; on_movie_start value + +# Command to be executed when a movie file (.mpg|.avi) is closed. (default: none) +# To give the filename as an argument to a command append it with %f +; on_movie_end value + +# Command to be executed when a camera can't be opened or if it is lost +# NOTE: There is situations when motion doesn't detect a lost camera! +# It depends on the driver, some drivers don't detect a lost camera at all +# Some hang the motion thread. Some even hang the PC! (default: none) +; on_camera_lost value + +############################################################ +# Common Options For MySQL and PostgreSQL database features. +# Options require the MySQL/PostgreSQL options to be active also. +############################################################ + +# Log to the database when creating motion triggered image file (default: on) +sql_log_image on + +# Log to the database when creating a snapshot image file (default: on) +sql_log_snapshot on + +# Log to the database when creating motion triggered mpeg file (default: off) +sql_log_mpeg off + +# Log to the database when creating timelapse mpeg file (default: off) +sql_log_timelapse off + +# SQL query string that is sent to the database +# Use same conversion specifiers has for text features +# Additional special conversion specifiers are +# %n = the number representing the file_type +# %f = filename with full path +# Default value: +# insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C') +sql_query insert into security(camera, filename, frame, file_type, time_stamp, event_time_stamp) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C') + + +############################################################ +# Database Options For MySQL +############################################################ + +# Mysql database to log to (default: not defined) +; mysql_db value + +# The host on which the database is located (default: localhost) +; mysql_host value + +# User account name for MySQL database (default: not defined) +; mysql_user value + +# User password for MySQL database (default: not defined) +; mysql_password value + + +############################################################ +# Database Options For PostgreSQL +############################################################ + +# PostgreSQL database to log to (default: not defined) +; pgsql_db value + +# The host on which the database is located (default: localhost) +; pgsql_host value + +# User account name for PostgreSQL database (default: not defined) +; pgsql_user value + +# User password for PostgreSQL database (default: not defined) +; pgsql_password value + +# Port on which the PostgreSQL database is located (default: 5432) +; pgsql_port 5432 + + +############################################################ +# Video Loopback Device (vloopback project) +############################################################ + +# Output images to a video4linux loopback device +# The value '-' means next available (default: not defined) +; video_pipe value + +# Output motion images to a video4linux loopback device +# The value '-' means next available (default: not defined) +; motion_video_pipe value + + +############################################################## +# Thread config files - One for each camera. +# Except if only one camera - You only need this config file. +# If you have more than one camera you MUST define one thread +# config file for each camera in addition to this config file. +############################################################## + +# Remember: If you have more than one camera you must have one +# thread file for each camera. E.g. 2 cameras requires 3 files: +# This motion.conf file AND thread1.conf and thread2.conf. +# Only put the options that are unique to each camera in the +# thread config files. +; thread /usr/local/etc/thread1.conf +; thread /usr/local/etc/thread2.conf +; thread /usr/local/etc/thread3.conf +; thread /usr/local/etc/thread4.conf + diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 35a6d1f14f..7abfe564d0 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -43,7 +43,7 @@ OPTION=0 REBOOT_REQUIRED=false TARGETMENUID=0 - + #Interger min/max value holders MIN_VALUE=0 MAX_VALUE=0 @@ -425,7 +425,7 @@ if (( $OPTION == 1 )); then MIN_VALUE=100 MAX_VALUE=2000 - OPTION=$(whiptail --inputbox "This will set the size of your swap file in MB. \n - Recommended value = 100 \n - Valid range $MIN_VALUE - $MAX_VALUE" 11 60 "$swap_size" --title "SwapFile Size (MB)" 3>&1 1>&2 2>&3) + OPTION=$(whiptail --inputbox "This will set the size of your swap file in MB.\n - Swapfile has a swapiness setting of 1 \n - Swapfile is used only to prevent out of memory errors \n - Recommended value = 100 \n - Valid range $MIN_VALUE - $MAX_VALUE" 13 65 "$swap_size" --title "SwapFile Size (MB)" 3>&1 1>&2 2>&3) CHOICE=$? if (( $CHOICE == 0 )); then if [[ $OPTION =~ ^-?[0-9]+$ ]] && (($OPTION <= $MAX_VALUE)) && (($OPTION >= $MIN_VALUE)); then @@ -468,7 +468,7 @@ #Enabled elif (( $usb_max_current_enabled == 1 )); then WHIP_QUESTION=" Current setting: $usb_max_current_text (1.2AMP) \n Would you like to disable this setting ? \n \n Once Disabled: \n - Max USB current will be set to 0.6AMP (default)" - whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --defaultno --yes-button "Disable" --no-button "Abort" --backtitle "$WHIP_BACKTITLE" 12 60 + whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --defaultno --yes-button "Disable" --no-button "Abort" --backtitle "$WHIP_BACKTITLE" 12 70 CHOICE=$? if (( $CHOICE == 0 )); then sed -i '/max_usb_current=/c\max_usb_current=0' /boot/config.txt @@ -477,7 +477,7 @@ #Disabled elif (( $usb_max_current_enabled == 0 )); then WHIP_QUESTION=" Current setting: $usb_max_current_text (0.6AMP) \n Would you like to enable this setting ? \n \n Once Enabled: \n - Max USB current will be set to 1.2AMP \n - (Warning) Do not enable this setting, unless you have a 2AMP+ PSU. " - whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --defaultno --yes-button "Enable" --no-button "Abort" --backtitle "$WHIP_BACKTITLE" 14 60 + whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --defaultno --yes-button "Enable" --no-button "Abort" --backtitle "$WHIP_BACKTITLE" 14 70 CHOICE=$? if (( $CHOICE == 0 )); then sed -i '/max_usb_current=/c\max_usb_current=1' /boot/config.txt @@ -664,8 +664,7 @@ CHOICE=$? if (( $CHOICE == 0 )) && [ "$hostname_existing" != "$OPTION" ]; then - sed -i "s/$hostname_existing/$OPTION/g" /etc/hosts - sed -i "s/$hostname_existing/$OPTION/g" /etc/hostname + /boot/dietpi/func/change_hostname "$OPTION" REBOOT_REQUIRED=true WHIP_TITLE='Hostname Change Completed' whiptail --title "$WHIP_TITLE" --msgbox " Your Hostname has been changed: \n - From $hostname_existing \n - To $OPTION" 9 60 @@ -682,7 +681,7 @@ TARGETMENUID=0 WHIP_TITLE='---------- DietPi - Security Options ----------' - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Lock down your DietPi Install" --cancel-button "Back" --backtitle "$WHIP_BACKTITLE" 14 60 2 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Lock down your DietPi Install" --cancel-button "Back" --backtitle "$WHIP_BACKTITLE" 12 60 2 \ "1" "Change Root Password" \ "2" "Change Hostname" 3>&1 1>&2 2>&3) diff --git a/dietpi/func/change_hostname b/dietpi/func/change_hostname new file mode 100644 index 0000000000..001eccae82 --- /dev/null +++ b/dietpi/func/change_hostname @@ -0,0 +1,34 @@ +#!/bin/bash +{ + #//////////////////////////////////// + # DietPi Function: + # - change_hostname + # + #//////////////////////////////////// + # Created by Dan Knight / daniel_haze@hotmail.com / fuzon.co.uk + # + #//////////////////////////////////// + # + # Info: + # - Used to change hostname on system + # - no exit code return, or status. + # + # Usage: + # - /boot/dietpi/func/change_hostname sNEWHOSTNAME + #//////////////////////////////////// + + #///////////////////////////////////////////////////////////////////////////////////// + #Change Hostname + #///////////////////////////////////////////////////////////////////////////////////// + HOSTNAME_CURRENT=$(cat /etc/hostname) + HOSTNAME_NEW=$1 + + #///////////////////////////////////////////////////////////////////////////////////// + # Main Loop + #///////////////////////////////////////////////////////////////////////////////////// + sed -i "s/$HOSTNAME_CURRENT/$HOSTNAME_NEW/g" /etc/hosts + sed -i "s/$HOSTNAME_CURRENT/$HOSTNAME_NEW/g" /etc/hostname + + #exit + exit +} \ No newline at end of file From fe24aba6b418c397453563088623be5ef6bf5577 Mon Sep 17 00:00:00 2001 From: Fourdee Date: Sun, 10 May 2015 05:51:47 +0100 Subject: [PATCH 04/14] v54 changelog update, added DietPi software list URL to 1st install prompt. --- CHANGELOG.txt | 14 ++++++++++---- dietpi/dietpi-software | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 154562a315..2e237d4253 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,8 +1,15 @@ +v54 +Added changelog. +Function | Change_hostname is now a global function script /func/ +DietPi-Config > Advanced | Better explination of swapfile. + +----------------------------------------------------------------------------------------------------------- + v53 (09/05/15) -EOL corrections in conf folder, resolves startup issues with YMPD/Softether/Opentyrian). +EOL corrections in /conf/ folder, resolves startup issues (with YMPD/Softether/Opentyrian). New func folder for global functions. (allows us to use re-occuring code in dietpi scripts) -dietpi-config > display > GPU mem split for RPI is now based on an array (optimized/cleaned coding) +dietpi-config > display | GPU mem split for RPI is now based on an array (optimized/cleaned coding) ----------------------------------------------------------------------------------------------------------- @@ -12,13 +19,12 @@ DietPi-Software | Modifications to help improve initial user experience. DietPi-Config > Display Options | Added support for RPi Camera. Enable/disable camera and led. DietPi General | Fix for dumb or unset TERM provided by tdaitx. Allows for SCP connections with OpenSSH Server installed. DietPi General | Added time-outs and retry limits when checking urls to prevent endless waiting (internet tests/apt repo checks etc). -DietPi-Software > Desktop (LXDE) | Trashcan is now disabled. This allows DietPi to save resources by not needing gvfs packages. ----------------------------------------------------------------------------------------------------------- v51 (05/05/15) -Disable PCmanFM trashcan (allows us to not require gvfs packages) +DietPi-Software > Desktop (LXDE) | Trashcan is now disabled. This allows DietPi to save resources by not needing gvfs packages. ----------------------------------------------------------------------------------------------------------- diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f54466be61..ed6cb6158b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1885,7 +1885,7 @@ fi WHIP_TITLE='DietPi - Questions Completed' - whiptail --title "$WHIP_TITLE" --msgbox "The DietPi-Software menu will now appear with the following options: \n\n- Select DietPi Optimized Software\nThis will allow you to select Optimized and Ready to Run software.\n\n- Select Additional Linux Software.\nThis will allow you to select standard linux software relative to this installation. \n\n- DietPi-Config\nA feature rich configuration tool for your device.\n \n- Go Start Install\nThis will start the installation process for your selected items." 20 75 + whiptail --title "$WHIP_TITLE" --msgbox "The DietPi-Software menu will now appear with the following options: \n\n- Select DietPi Optimized Software\nThis will allow you to select Optimized and Ready to Run software.\nFull list and details: http://fuzon.co.uk/phpbb/viewtopic.php?f=8&t=5\n\n- Select Additional Linux Software.\nThis will allow you to select standard linux software relative to this installation. \n\n- DietPi-Config\nA feature rich configuration tool for your device.\n \n- Go Start Install\nThis will start the installation process for your selected items." 21 75 fi #-------------------------------------------------------------------------------------- From 9abf45f0cda2b6751a6120a0ee48a0f61529ca11 Mon Sep 17 00:00:00 2001 From: Fourdee Date: Sun, 10 May 2015 09:02:34 +0100 Subject: [PATCH 05/14] v54 DietPi-Software | Seperated internal install flags for Webserver. Allows for applications to be installed that require only parts of the LAMP stack. /boot/dietpi/conf/index.php has changed to phpinfo.php. Allows us to reserve index.php for other software. --- CHANGELOG.txt | 7 +- dietpi/conf/{index.php => phpinfo.php} | 0 dietpi/dietpi-software | 279 +++++++++++++++++-------- dietpi/patch_file | 32 +++ 4 files changed, 232 insertions(+), 86 deletions(-) rename dietpi/conf/{index.php => phpinfo.php} (100%) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2e237d4253..d5f66abac5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,8 +1,13 @@ v54 +Release Notes: Added changelog. -Function | Change_hostname is now a global function script /func/ DietPi-Config > Advanced | Better explination of swapfile. +Code Related: +DietPi-Software | Seperated internal install flags for Webserver. Allows for applications to be installed that require only parts of the LAMP stack. +/func/ | Change_hostname is now a global function script +/boot/dietpi/conf/index.php has changed to phpinfo.php. Allows us to reserve index.php for other software. + ----------------------------------------------------------------------------------------------------------- v53 diff --git a/dietpi/conf/index.php b/dietpi/conf/phpinfo.php similarity index 100% rename from dietpi/conf/index.php rename to dietpi/conf/phpinfo.php diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ed6cb6158b..78dcbcdf86 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -58,7 +58,13 @@ #Installed state # 0 = not installed / 1 = to be installed / 2 = installed USBDRIVE=0 DESKTOP=0 - WEBSERVER=0 + + WEBSERVER_LAMP=0 + WEBSERVER_APACHE=0 + WEBSERVER_MYSQL=0 + WEBSERVER_PHP=0 + WEBSERVER_PHPMYADMIN=0 + OWNCLOUD=0 TRANSMISSION=0 PHPBB=0 @@ -98,7 +104,11 @@ echo -e "#DietPi Software" >> /boot/dietpi/.installed echo -e "DESKTOP $DESKTOP" >> /boot/dietpi/.installed - echo -e "WEBSERVER $WEBSERVER" >> /boot/dietpi/.installed + echo -e "WEBSERVER_LAMP $WEBSERVER_LAMP" >> /boot/dietpi/.installed + echo -e "WEBSERVER_APACHE $WEBSERVER_APACHE" >> /boot/dietpi/.installed + echo -e "WEBSERVER_MYSQL $WEBSERVER_MYSQL" >> /boot/dietpi/.installed + echo -e "WEBSERVER_PHP $WEBSERVER_PHP" >> /boot/dietpi/.installed + echo -e "WEBSERVER_PHPMYADMIN $WEBSERVER_PHPMYADMIN" >> /boot/dietpi/.installed echo -e "OWNCLOUD $OWNCLOUD" >> /boot/dietpi/.installed echo -e "TRANSMISSION $TRANSMISSION" >> /boot/dietpi/.installed echo -e "PHPBB $PHPBB" >> /boot/dietpi/.installed @@ -127,42 +137,45 @@ Install_ReloadChoices(){ #DietPi - USBDRIVE=$(cat /boot/dietpi/.installed | grep USBDRIVE | awk '{print $2}') - - DESKTOP=$(cat /boot/dietpi/.installed | grep DESKTOP | awk '{print $2}') - WEBSERVER=$(cat /boot/dietpi/.installed | grep WEBSERVER | awk '{print $2}') - OWNCLOUD=$(cat /boot/dietpi/.installed | grep OWNCLOUD | awk '{print $2}') - TRANSMISSION=$(cat /boot/dietpi/.installed | grep TRANSMISSION | awk '{print $2}') - PHPBB=$(cat /boot/dietpi/.installed | grep PHPBB | awk '{print $2}') - PROFTP=$(cat /boot/dietpi/.installed | grep PROFTP | awk '{print $2}') - KODI=$(cat /boot/dietpi/.installed | grep KODI | awk '{print $2}') - RETROPIE=$(cat /boot/dietpi/.installed | grep RETROPIE | awk '{print $2}') - MINIDLNA=$(cat /boot/dietpi/.installed | grep MINIDLNA | awk '{print $2}') - NOIPDYNDNS=$(cat /boot/dietpi/.installed | grep NOIPDYNDNS | awk '{print $2}') - YMPD=$(cat /boot/dietpi/.installed | grep YMPD | awk '{print $2}') - SMBSERVER=$(cat /boot/dietpi/.installed | grep SMBSERVER | awk '{print $2}') - VPNSERVER=$(cat /boot/dietpi/.installed | grep VPNSERVER | awk '{print $2}') - OPENTYRIAN=$(cat /boot/dietpi/.installed | grep OPENTYRIAN | awk '{print $2}') - - #Additions must be checked before getting data - #if (($(cat /boot/dietpi/.installed | grep -ci -m1 'OPENTYRIAN') == 1)); then - #OPENTYRIAN=$(cat /boot/dietpi/.installed | grep OPENTYRIAN | awk '{print $2}') - #fi - + USBDRIVE=$(cat /boot/dietpi/.installed | grep 'USBDRIVE ' | awk '{print $2}') + + DESKTOP=$(cat /boot/dietpi/.installed | grep 'DESKTOP ' | awk '{print $2}') + WEBSERVER_LAMP=$(cat /boot/dietpi/.installed | grep 'WEBSERVER_LAMP ' | awk '{print $2}') + WEBSERVER_APACHE=$(cat /boot/dietpi/.installed | grep 'WEBSERVER_APACHE ' | awk '{print $2}') + WEBSERVER_MYSQL=$(cat /boot/dietpi/.installed | grep 'WEBSERVER_MYSQL ' | awk '{print $2}') + WEBSERVER_PHP=$(cat /boot/dietpi/.installed | grep 'WEBSERVER_PHP ' | awk '{print $2}') + WEBSERVER_PHPMYADMIN=$(cat /boot/dietpi/.installed | grep 'WEBSERVER_PHPMYADMIN ' | awk '{print $2}') + OWNCLOUD=$(cat /boot/dietpi/.installed | grep 'OWNCLOUD ' | awk '{print $2}') + TRANSMISSION=$(cat /boot/dietpi/.installed | grep 'TRANSMISSION ' | awk '{print $2}') + PHPBB=$(cat /boot/dietpi/.installed | grep 'PHPBB ' | awk '{print $2}') + PROFTP=$(cat /boot/dietpi/.installed | grep 'PROFTP ' | awk '{print $2}') + KODI=$(cat /boot/dietpi/.installed | grep 'KODI ' | awk '{print $2}') + RETROPIE=$(cat /boot/dietpi/.installed | grep 'RETROPIE ' | awk '{print $2}') + MINIDLNA=$(cat /boot/dietpi/.installed | grep 'MINIDLNA ' | awk '{print $2}') + NOIPDYNDNS=$(cat /boot/dietpi/.installed | grep 'NOIPDYNDNS ' | awk '{print $2}') + YMPD=$(cat /boot/dietpi/.installed | grep 'YMPD ' | awk '{print $2}') + SMBSERVER=$(cat /boot/dietpi/.installed | grep 'SMBSERVER ' | awk '{print $2}') + VPNSERVER=$(cat /boot/dietpi/.installed | grep 'VPNSERVER ' | awk '{print $2}') + OPENTYRIAN=$(cat /boot/dietpi/.installed | grep 'OPENTYRIAN ' | awk '{print $2}') + #Linux - VIMFULL=$(cat /boot/dietpi/.installed | grep VIMFULL | awk '{print $2}') - SSHCLIENT=$(cat /boot/dietpi/.installed | grep SSHCLIENT | awk '{print $2}') - SMBCLIENT=$(cat /boot/dietpi/.installed | grep SMBCLIENT | awk '{print $2}') - RPIGPIO=$(cat /boot/dietpi/.installed | grep RPIGPIO | awk '{print $2}') - GITCLIENT=$(cat /boot/dietpi/.installed | grep GITCLIENT | awk '{print $2}') - BUILDESSENTIAL=$(cat /boot/dietpi/.installed | grep BUILDESSENTIAL | awk '{print $2}') - ALSABASE=$(cat /boot/dietpi/.installed | grep ALSABASE | awk '{print $2}') - XSERVERXORG=$(cat /boot/dietpi/.installed | grep XSERVERXORG | awk '{print $2}') - - #Additions must be checked before getting data - #if (($(cat /boot/dietpi/.installed | grep -ci -m1 'RPIGPIO') == 1)); then - #RPIGPIO=$(cat /boot/dietpi/.installed | grep RPIGPIO | awk '{print $2}') - #fi + VIMFULL=$(cat /boot/dietpi/.installed | grep 'VIMFULL ' | awk '{print $2}') + SSHCLIENT=$(cat /boot/dietpi/.installed | grep 'SSHCLIENT ' | awk '{print $2}') + SMBCLIENT=$(cat /boot/dietpi/.installed | grep 'SMBCLIENT ' | awk '{print $2}') + RPIGPIO=$(cat /boot/dietpi/.installed | grep 'RPIGPIO ' | awk '{print $2}') + GITCLIENT=$(cat /boot/dietpi/.installed | grep 'GITCLIENT ' | awk '{print $2}') + BUILDESSENTIAL=$(cat /boot/dietpi/.installed | grep 'BUILDESSENTIAL ' | awk '{print $2}') + ALSABASE=$(cat /boot/dietpi/.installed | grep 'ALSABASE ' | awk '{print $2}') + XSERVERXORG=$(cat /boot/dietpi/.installed | grep 'XSERVERXORG ' | awk '{print $2}') + + #Take note of the extra space used at the end of each grep quote 'MYSOFTWARE ' + #This ensures packages with similar names (eg: WEBSERVER_PHP and WEBSERVER_PHPMYADMIN) dont both get picked up. + + #Additions must be added to patch file, if /boot/dietpi/.installed exists on host system! + #eg + # if [ -f /boot/dietpi/.installed ]; then + # #echo -e "MYNEWPROGRAM 0" >> /boot/dietpi/.installed + # fi } @@ -185,12 +198,21 @@ PROFTP=1 fi - # Installs that require Apache Webserver + # Installs that require WEBSERVER_LAMP (WEBSERVER_APACHE / WEBSERVER_MYSQL / WEBSERVER_PHP / WEBSERVER_PHPMYADMIN) if (( $OWNCLOUD == 1 )); then - WEBSERVER=1 + WEBSERVER_LAMP=1 elif (( $PHPBB == 1 )); then - WEBSERVER=1 + WEBSERVER_LAMP=1 + fi + + #define extra DietPi flags for WEBSERVER_LAMP (WEBSERVER_APACHE / WEBSERVER_MYSQL / WEBSERVER_PHP / WEBSERVER_PHPMYADMIN) + if (( $WEBSERVER_LAMP == 1 )); then + WEBSERVER_APACHE=1 + WEBSERVER_MYSQL=1 + WEBSERVER_PHP=1 + WEBSERVER_PHPMYADMIN=1 fi + #-------------------------------------------------------------- #Install Software @@ -206,29 +228,37 @@ fi + #BitTorrent Transmission if (( $TRANSMISSION == 1 )); then INSTALL_DESCRIPTION='BitTorrent (Transmission)' Banner_Installing apt-get install transmission-daemon -y fi + #ProFTPd if (( $PROFTP == 1 )); then INSTALL_DESCRIPTION='FTP Server (Proftp)' Banner_Installing apt-get install proftpd-basic -y fi - # Apache2 - if (( $WEBSERVER == 1 )); then + #WEBSERVER_APACHE + if (( $WEBSERVER_APACHE == 1 )); then INSTALL_DESCRIPTION='(Apache2) / Mysql / php5 / phpmyadmin' Banner_Installing apt-get install apache2 -y + fi + #WEBSERVER_MYSQL + if (( $WEBSERVER_MYSQL == 1 )); then INSTALL_DESCRIPTION='Apache2 / (Mysql) / php5 / phpmyadmin' Banner_Installing apt-get install mysql-server -y + fi + #WEBSERVER_PHP + if (( $WEBSERVER_PHP == 1 )); then INSTALL_DESCRIPTION='Apache2 / Mysql / (php5) / phpmyadmin' Banner_Installing apt-get install php5 libapache2-mod-php5 -y @@ -240,17 +270,20 @@ elif (( $DISTRO == 2 )); then apt-get install php5-apcu -y fi - + fi + + #WEBSERVER_PHPMYADMIN + if (( $WEBSERVER_PHPMYADMIN == 1 )); then INSTALL_DESCRIPTION='Apache2 / Mysql / php5 / (phpmyadmin)' Banner_Installing apt-get install phpmyadmin -y + fi - #Forums PHPBB - if (( $PHPBB == 1 )); then - INSTALL_DESCRIPTION='PHPBB Forums' - Banner_Installing - apt-get install phpbb3 -y - fi + #Forums PHPBB + if (( $PHPBB == 1 )); then + INSTALL_DESCRIPTION='PHPBB Forums' + Banner_Installing + apt-get install phpbb3 -y fi #OwnCloud @@ -674,15 +707,17 @@ DESKTOP=2 fi - #Apache2 - if (( $WEBSERVER == 1 )); then - #Copy PHP web test file - cp /boot/dietpi/conf/index.php /var/www/index.php - - #Set PHP.INI to UTF-8 - sed -i '/default_charset/c\default_charset = "UTF-8"' /etc/php5/apache2/php.ini - sed -i '/default_charset/c\default_charset = "UTF-8"' /etc/php5/cli/php.ini - + #WEBSERVER_LAMP + if (( $WEBSERVER_LAMP == 1 )); then + #mkdir -p /var/www + #chown -R www-data:www-data /var/www + + WEBSERVER_LAMP=2 + fi + + #WEBSERVER_APACHE + if (( $WEBSERVER_APACHE == 1 )); then + #Odroid C1 if (( $HW_MODEL == 10 )); then #Apache2 confs @@ -692,13 +727,6 @@ cp /boot/dietpi/conf/apache2_c1_mpmprefork /etc/apache2/mods-available/mpm_prefork.conf cp /boot/dietpi/conf/apache2_c1_mpmworker /etc/apache2/mods-available/mpm_worker.conf - #php-apcU - echo -e "extension=apcu.so" > /etc/php5/apache2/conf.d/20-apcu.ini - echo -e "apc.enabled=1" >> /etc/php5/apache2/conf.d/20-apcu.ini - echo -e "apc.shm_size=64M" >> /etc/php5/apache2/conf.d/20-apcu.ini - echo -e "apc.ttl=259200 (3 Days)" >> /etc/php5/apache2/conf.d/20-apcu.ini - cp /usr/share/doc/php5-apcu/apc.php /var/www/apc.php - #Use /var/www as default webfolder mv /var/www/html/index.html /var/www/index.html rm -R /var/www/html @@ -707,7 +735,36 @@ elif (( $HW_MODEL == 2 )); then #Apache2 confs cp /boot/dietpi/conf/apache2_p2.conf /etc/apache2/apache2.conf - + elif (( $HW_MODEL == 1 )); then + #Apache2 confs + cp /boot/dietpi/conf/apache2_p1.conf /etc/apache2/apache2.conf + elif (( $HW_MODEL == 0 )); then + #Apache2 confs + cp /boot/dietpi/conf/apache2_p1.conf /etc/apache2/apache2.conf + fi + + WEBSERVER_APACHE=2 + fi + + #WEBSERVER_MYSQL + if (( $WEBSERVER_MYSQL == 1 )); then + + WEBSERVER_MYSQL=2 + fi + + #WEBSERVER_PHP + if (( $WEBSERVER_PHP == 1 )); then + + #Odroid C1 + if (( $HW_MODEL == 10 )); then + #php-apcU + echo -e "extension=apcu.so" > /etc/php5/apache2/conf.d/20-apcu.ini + echo -e "apc.enabled=1" >> /etc/php5/apache2/conf.d/20-apcu.ini + echo -e "apc.shm_size=64M" >> /etc/php5/apache2/conf.d/20-apcu.ini + echo -e "apc.ttl=259200 (3 Days)" >> /etc/php5/apache2/conf.d/20-apcu.ini + cp /usr/share/doc/php5-apcu/apc.php /var/www/apc.php + #Rpi + elif (( $HW_MODEL == 2 )); then #php-apc echo -e "extension=apc.so" > /etc/php5/apache2/conf.d/20-apc.ini echo -e "apc.enabled=1" >> /etc/php5/apache2/conf.d/20-apc.ini @@ -715,9 +772,6 @@ echo -e "apc.ttl=259200 (3 Days)" >> /etc/php5/apache2/conf.d/20-apc.ini cp /usr/share/doc/php-apc/apc.php /var/www/apc.php elif (( $HW_MODEL == 1 )); then - #Apache2 confs - cp /boot/dietpi/conf/apache2_p1.conf /etc/apache2/apache2.conf - #php-apc echo -e "extension=apc.so" > /etc/php5/apache2/conf.d/20-apc.ini echo -e "apc.enabled=1" >> /etc/php5/apache2/conf.d/20-apc.ini @@ -725,9 +779,6 @@ echo -e "apc.ttl=259200 (3 Days)" >> /etc/php5/apache2/conf.d/20-apc.ini cp /usr/share/doc/php-apc/apc.php /var/www/apc.php elif (( $HW_MODEL == 0 )); then - #Apache2 confs - cp /boot/dietpi/conf/apache2_p1.conf /etc/apache2/apache2.conf - #php-apc echo -e "extension=apc.so" > /etc/php5/apache2/conf.d/20-apc.ini echo -e "apc.enabled=1" >> /etc/php5/apache2/conf.d/20-apc.ini @@ -736,9 +787,22 @@ cp /usr/share/doc/php-apc/apc.php /var/www/apc.php fi - WEBSERVER=2 + #Copy PHP web test file + cp /boot/dietpi/conf/phpinfo.php /var/www/phpinfo.php + + #Set PHP.INI to UTF-8 + sed -i '/default_charset/c\default_charset = "UTF-8"' /etc/php5/apache2/php.ini + sed -i '/default_charset/c\default_charset = "UTF-8"' /etc/php5/cli/php.ini + + WEBSERVER_PHP=2 fi + #WEBSERVER_PHPMYADMIN + if (( $WEBSERVER_PHPMYADMIN == 1 )); then + + WEBSERVER_PHPMYADMIN=2 + fi + #OwnCloud if (( $OWNCLOUD == 1 )); then mkdir /mnt/usb_1/owncloud_data @@ -1288,15 +1352,59 @@ fi fi - local webserver_w="off" - if (( $WEBSERVER > 0 )); then - webserver_w="on" + local webserver_lamp_w="off" + if (( $WEBSERVER_LAMP > 0 )); then + webserver_lamp_w="on" + #Reset to 0. Menu checklists will apply back to 1 + if (( $WEBSERVER_LAMP == 1 )); then + WEBSERVER_LAMP=0 + fi + fi + + #----------------------------------------------------------------------------------------------- + #Below this line, options are not currently available in the menu. Here for consistency/future use + #----------------------------------------------------------------------------------------------- + + local webserver_apache_w="off" + if (( $WEBSERVER_APACHE > 0 )); then + webserver_apache_w="on" + #Reset to 0. Menu checklists will apply back to 1 + if (( $WEBSERVER_APACHE == 1 )); then + WEBSERVER_APACHE=0 + fi + fi + + local webserver_mysql_w="off" + if (( $WEBSERVER_MYSQL > 0 )); then + webserver_mysql_w="on" #Reset to 0. Menu checklists will apply back to 1 - if (( $WEBSERVER == 1 )); then - WEBSERVER=0 + if (( $WEBSERVER_MYSQL == 1 )); then + WEBSERVER_MYSQL=0 fi fi + local webserver_php_w="off" + if (( $WEBSERVER_PHP > 0 )); then + webserver_php_w="on" + #Reset to 0. Menu checklists will apply back to 1 + if (( $WEBSERVER_PHP == 1 )); then + WEBSERVER_PHP=0 + fi + fi + + local webserver_phpmyadmin_w="off" + if (( $WEBSERVER_PHPMYADMIN > 0 )); then + webserver_phpmyadmin_w="on" + #Reset to 0. Menu checklists will apply back to 1 + if (( $WEBSERVER_PHPMYADMIN == 1 )); then + WEBSERVER_PHPMYADMIN=0 + fi + fi + + #----------------------------------------------------------------------------------------------- + #End-------------------------------------------------------------------------------------------- + #----------------------------------------------------------------------------------------------- + local proftp_w="off" if (( $PROFTP > 0 )); then proftp_w="on" @@ -1386,7 +1494,7 @@ "5" "BitTorrent (Transmission)" $transmission_w \ "6" "OwnCloud" $owncloud_w \ "9" "Forums (PHPBB)" $phpbb_w \ - "10" "WebServer (Apache2/mysql/php5/phpmyadmin)" $webserver_w \ + "10" "WebServer (Apache2/mysql/php5/phpmyadmin)" $webserver_lamp_w \ "11" "FTP Server (Proftp)" $proftp_w \ "12" "File Server (Samba)" $smbserver_w \ "13" "VPN Server (SoftEther)" $vpnserver_w \ @@ -1404,7 +1512,7 @@ "7" "DLNA/UPnP Media Server (MiniDLNA)" $minidlna_w \ "8" "HiFi / Web Interface Music Player (Mpd Ympd)" $ympd_w \ "9" "Forums (PHPBB)" $phpbb_w \ - "10" "WebServer (Apache2/mysql/php5/phpmyadmin)" $webserver_w \ + "10" "WebServer (Apache2/mysql/php5/phpmyadmin)" $webserver_lamp_w \ "11" "FTP Server (Proftp)" $proftp_w \ "12" "File Server (Samba)" $smbserver_w \ "13" "VPN Server (SoftEther)" $vpnserver_w \ @@ -1477,8 +1585,8 @@ fi ;; 10) - if (( $WEBSERVER == 0 )); then - WEBSERVER=1 + if (( $WEBSERVER_LAMP == 0 )); then + WEBSERVER_LAMP=1 INSTALL_DIETPI_CHOICESMADE=true fi ;; @@ -1507,8 +1615,9 @@ fi ;; esac - done < results - rm results + #done < results + #rm results + done #Install Info/Warnings @@ -1885,7 +1994,7 @@ fi WHIP_TITLE='DietPi - Questions Completed' - whiptail --title "$WHIP_TITLE" --msgbox "The DietPi-Software menu will now appear with the following options: \n\n- Select DietPi Optimized Software\nThis will allow you to select Optimized and Ready to Run software.\nFull list and details: http://fuzon.co.uk/phpbb/viewtopic.php?f=8&t=5\n\n- Select Additional Linux Software.\nThis will allow you to select standard linux software relative to this installation. \n\n- DietPi-Config\nA feature rich configuration tool for your device.\n \n- Go Start Install\nThis will start the installation process for your selected items." 21 75 + whiptail --title "$WHIP_TITLE" --msgbox "The DietPi-Software menu will now appear with the following options: \n\n- Select DietPi Optimized Software\nThis will allow you to select Optimized and Ready to Run software.\nhttp://fuzon.co.uk/phpbb/viewtopic.php?f=8&t=5\n\n- Select Additional Linux Software.\nThis will allow you to select standard linux software relative to this installation. \n\n- DietPi-Config\nA feature rich configuration tool for your device.\n \n- Go Start Install\nThis will start the installation process for your selected items." 21 75 fi #-------------------------------------------------------------------------------------- diff --git a/dietpi/patch_file b/dietpi/patch_file index 175490219f..b6107a25b2 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -10,6 +10,10 @@ # # Info: # - Online patching for hosts filesystem. + # - Runs from dietpi-update + # + # Usage: + # - /boot/dietpi/patch_file iCurrentVersion iServerVersion #//////////////////////////////////// #///////////////////////////////////////////////////////////////////////////////////// @@ -88,6 +92,34 @@ elif (( $VERSION_CURRENT == 53 )); then echo -e "53 > 54 patch" + #WEBSERVER install flag has changed to split system. patch host .installed file. + if [ -f /boot/dietpi/.installed ]; then + + #Get current installed state value + temp_value=$(cat /boot/dietpi/.installed | grep 'WEBSERVER' | awk '{print $2}') + + #Change WEBSERVER to WEBSERVER_LAMP + sed -i "/WEBSERVER/c\WEBSERVER_LAMP $temp_value" /boot/dietpi/.installed + + #echo new webserver installation splits to /boot/dietpi/.installed + echo -e "WEBSERVER_APACHE $temp_value" >> /boot/dietpi/.installed + echo -e "WEBSERVER_PHP $temp_value" >> /boot/dietpi/.installed + echo -e "WEBSERVER_MYSQL $temp_value" >> /boot/dietpi/.installed + echo -e "WEBSERVER_PHPMYADMIN $temp_value" >> /boot/dietpi/.installed + fi + + #/boot/dietpi/conf/index.php has changed to phpinfo.php. Allows us to reserve index.php for other software. + #Apply to hostsystem + if [ -f /var/www/index.php ]; then + #Check its our file + if (( $(cat /var/www/index.php | grep -ci -m1 'phpinfo()') == 1 )); then + rm /var/www/index.php + cp /boot/dietpi/conf/phpinfo.php /var/www/phpinfo.php + fi + fi + #Remove the old index.php from boot partition /dietpi/conf/ + rm /boot/dietpi/conf/index.php + fi sleep 2 From 0c202a58f4fb5a5b6391f2f4fcebc05438296cce Mon Sep 17 00:00:00 2001 From: Fourdee Date: Sun, 10 May 2015 11:40:22 +0100 Subject: [PATCH 06/14] v54 Modify PHP-apc/u conf file to remove "(3days)" Added DietPicam configs/inits finalization of new WEBSERVER_x installation flags --- CHANGELOG.txt | 1 + dietpi/conf/desktop/NOTES.txt | 8 +++++--- dietpi/conf/desktop/pcmanfm-desktopitems.conf | 3 +-- dietpi/conf/{motion.conf => dietpicam_motion} | 6 +++--- .../conf/{raspimjpeg => dietpicam_raspimjpeg} | 19 ++++++++++--------- ...pimjpeg_init => dietpicam_raspimjpeg_init} | 2 +- dietpi/dietpi-software | 12 ++++++++---- dietpi/patch_file | 8 ++++++++ 8 files changed, 37 insertions(+), 22 deletions(-) rename dietpi/conf/{motion.conf => dietpicam_motion} (99%) rename dietpi/conf/{raspimjpeg => dietpicam_raspimjpeg} (81%) rename dietpi/conf/{raspimjpeg_init => dietpicam_raspimjpeg_init} (92%) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d5f66abac5..0b3397f1b9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v54 Release Notes: Added changelog. DietPi-Config > Advanced | Better explination of swapfile. +DietPi-Software | Changed PHP-apc/u conf files to remove "( 3 days )". It was causing php errors line 4. Code Related: DietPi-Software | Seperated internal install flags for Webserver. Allows for applications to be installed that require only parts of the LAMP stack. diff --git a/dietpi/conf/desktop/NOTES.txt b/dietpi/conf/desktop/NOTES.txt index 6302910a7d..1235cc290d 100644 --- a/dietpi/conf/desktop/NOTES.txt +++ b/dietpi/conf/desktop/NOTES.txt @@ -1,3 +1,5 @@ -DietPi-* = DietPi Menu and Desktop entries for LXDE -.gtk-bookmarks = DietPi PCManFM favourites links (~/.gtk-bookmarks) -panel = LXDE panel setup (~/.config/lxpanel/LXDE/panels/panel) \ No newline at end of file +DietPi-* | *.desktop = DietPi Menu and Desktop entries for LXDE +.gtk-bookmarks = DietPi PCManFM favourites links (~/.gtk-bookmarks) +panel = LXDE panel setup (~/.config/lxpanel/LXDE/panels/panel) +lxde-rc.xml = Openbox config (~/.config/openbox/lxde-rc.xml) +pcmanfm* = Pcmanfm configs \ No newline at end of file diff --git a/dietpi/conf/desktop/pcmanfm-desktopitems.conf b/dietpi/conf/desktop/pcmanfm-desktopitems.conf index e2c7526b95..0e583161a0 100644 --- a/dietpi/conf/desktop/pcmanfm-desktopitems.conf +++ b/dietpi/conf/desktop/pcmanfm-desktopitems.conf @@ -9,6 +9,5 @@ desktop_font=Sans 12 show_wm_menu=0 sort=mtime;ascending; show_documents=0 -show_trash=1 +show_trash=0 show_mounts=0 - diff --git a/dietpi/conf/motion.conf b/dietpi/conf/dietpicam_motion similarity index 99% rename from dietpi/conf/motion.conf rename to dietpi/conf/dietpicam_motion index 469a74841f..6f8667ac5e 100644 --- a/dietpi/conf/motion.conf +++ b/dietpi/conf/dietpicam_motion @@ -356,7 +356,7 @@ text_double off # Target base directory for pictures and films # Recommended to use absolute path. (Default: current working directory) -target_dir /var/www/media +target_dir /var/www/dietpicam/media # File path for snapshots (jpeg or ppm) relative to target_dir # Default: %v-%Y%m%d%H%M%S-snapshot @@ -510,11 +510,11 @@ quiet on # Command to be executed when an event starts. (default: none) # An event starts at first motion detected after a period of no motion defined by gap -on_event_start echo -n '1' > /var/www/FIFO1 +on_event_start echo -n '1' > /var/www/dietpicam/FIFO1 # Command to be executed when an event ends after a period of no motion # (default: none). The period of no motion is defined by option gap. -on_event_end echo -n '0' > /var/www/FIFO1 +on_event_end echo -n '0' > /var/www/dietpicam/FIFO1 # Command to be executed when a picture (.ppm|.jpg) is saved (default: none) # To give the filename as an argument to a command append it with %f diff --git a/dietpi/conf/raspimjpeg b/dietpi/conf/dietpicam_raspimjpeg similarity index 81% rename from dietpi/conf/raspimjpeg rename to dietpi/conf/dietpicam_raspimjpeg index ce758d4f20..685eca0d5f 100644 --- a/dietpi/conf/raspimjpeg +++ b/dietpi/conf/dietpicam_raspimjpeg @@ -82,13 +82,13 @@ tl_interval 30 # image+video path: add %d for number, year, month, day, hour, minute, second # preview_path /dev/shm/mjpeg/cam.jpg -image_path /var/www/media/im_%i_%Y%M%D_%h%m%s.jpg -lapse_path /var/www/media/tl_%i_%t_%Y%M%D_%h%m%s.jpg -video_path /var/www/media/vi_%v_%Y%M%D_%h%m%s.mp4 -status_file /var/www/status_mjpeg.txt -control_file /var/www/FIFO -media_path /var/www/media -macros_path /var/www/macros +image_path /var/www/dietpicam/media/im_%i_%Y%M%D_%h%m%s.jpg +lapse_path /var/www/dietpicam/media/tl_%i_%t_%Y%M%D_%h%m%s.jpg +video_path /var/www/dietpicam/media/vi_%v_%Y%M%D_%h%m%s.mp4 +status_file /var/www/dietpicam/status_mjpeg.txt +control_file /var/www/dietpicam/FIFO +media_path /var/www/dietpicam/media +macros_path /var/www/dietpicam/macros subdir_char @ # thumb generator control @@ -111,7 +111,8 @@ watchdog_interval 30 watchdog_errors 3 #optional user_config file to overwrite (persist) changes -user_config /var/www/uconfig +user_config /var/www/dietpicam/uconfig #logfile for raspimjpeg, default to merge with scheduler log -log_file /var/www/scheduleLog.txt +#log_file /var/www/dietpicam/scheduleLog.txt +log_file /var/log/dietpicam_raspimjpeg diff --git a/dietpi/conf/raspimjpeg_init b/dietpi/conf/dietpicam_raspimjpeg_init similarity index 92% rename from dietpi/conf/raspimjpeg_init rename to dietpi/conf/dietpicam_raspimjpeg_init index 79deae3613..875f88dc94 100644 --- a/dietpi/conf/raspimjpeg_init +++ b/dietpi/conf/dietpicam_raspimjpeg_init @@ -29,7 +29,7 @@ su -c 'raspimjpeg > /dev/null &' www-data sleep 1 - su -c 'php /var/www/schedule.php > /dev/null &' www-data + su -c 'php /var/www/dietpicam/schedule.php > /dev/null &' www-data } if [ "$1" = "stop" ] || [ "$1" = "restart" ]; then diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 78dcbcdf86..7ed519f2fc 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -761,7 +761,8 @@ echo -e "extension=apcu.so" > /etc/php5/apache2/conf.d/20-apcu.ini echo -e "apc.enabled=1" >> /etc/php5/apache2/conf.d/20-apcu.ini echo -e "apc.shm_size=64M" >> /etc/php5/apache2/conf.d/20-apcu.ini - echo -e "apc.ttl=259200 (3 Days)" >> /etc/php5/apache2/conf.d/20-apcu.ini + # (3 Days) + echo -e "apc.ttl=259200" >> /etc/php5/apache2/conf.d/20-apcu.ini cp /usr/share/doc/php5-apcu/apc.php /var/www/apc.php #Rpi elif (( $HW_MODEL == 2 )); then @@ -769,21 +770,24 @@ echo -e "extension=apc.so" > /etc/php5/apache2/conf.d/20-apc.ini echo -e "apc.enabled=1" >> /etc/php5/apache2/conf.d/20-apc.ini echo -e "apc.shm_size=64M" >> /etc/php5/apache2/conf.d/20-apc.ini - echo -e "apc.ttl=259200 (3 Days)" >> /etc/php5/apache2/conf.d/20-apc.ini + # (3 Days) + echo -e "apc.ttl=259200" >> /etc/php5/apache2/conf.d/20-apc.ini cp /usr/share/doc/php-apc/apc.php /var/www/apc.php elif (( $HW_MODEL == 1 )); then #php-apc echo -e "extension=apc.so" > /etc/php5/apache2/conf.d/20-apc.ini echo -e "apc.enabled=1" >> /etc/php5/apache2/conf.d/20-apc.ini echo -e "apc.shm_size=32M" >> /etc/php5/apache2/conf.d/20-apc.ini - echo -e "apc.ttl=259200 (3 Days)" >> /etc/php5/apache2/conf.d/20-apc.ini + # (3 Days) + echo -e "apc.ttl=259200" >> /etc/php5/apache2/conf.d/20-apc.ini cp /usr/share/doc/php-apc/apc.php /var/www/apc.php elif (( $HW_MODEL == 0 )); then #php-apc echo -e "extension=apc.so" > /etc/php5/apache2/conf.d/20-apc.ini echo -e "apc.enabled=1" >> /etc/php5/apache2/conf.d/20-apc.ini echo -e "apc.shm_size=12M" >> /etc/php5/apache2/conf.d/20-apc.ini - echo -e "apc.ttl=259200 (3 Days)" >> /etc/php5/apache2/conf.d/20-apc.ini + # (3 Days) + echo -e "apc.ttl=259200" >> /etc/php5/apache2/conf.d/20-apc.ini cp /usr/share/doc/php-apc/apc.php /var/www/apc.php fi diff --git a/dietpi/patch_file b/dietpi/patch_file index b6107a25b2..86ce0307a4 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -120,6 +120,14 @@ #Remove the old index.php from boot partition /dietpi/conf/ rm /boot/dietpi/conf/index.php + #Modify PHP-apc/u conf file to remove "(3days)" .It was causing php errors line 4. + #Debian + if (( $DISTRO == 1 )); then + sed -i "/apc.ttl=/c\apc.ttl=259200" /etc/php5/apache2/conf.d/20-apc.ini + #Ubuntu + elif (( $DISTRO == 2 )); then + sed -i "/apc.ttl=/c\apc.ttl=259200" /etc/php5/apache2/conf.d/20-apcu.ini + fi fi sleep 2 From cc2f3450778c681f138f0c00609c77142aa365a8 Mon Sep 17 00:00:00 2001 From: Fourdee Date: Sun, 10 May 2015 15:04:56 +0100 Subject: [PATCH 07/14] v54 DietPi-Software | Added initial DietPi optimized install option for "RPi Camera Surveillance (DietPi-Cam)" --- CHANGELOG.txt | 7 ++- dietpi/dietpi-software | 132 +++++++++++++++++++++++++++++++++++++---- dietpi/patch_file | 5 ++ 3 files changed, 131 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0b3397f1b9..702102967f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,11 +1,12 @@ v54 Release Notes: -Added changelog. -DietPi-Config > Advanced | Better explination of swapfile. +DietPi-Software | Added DietPi optimized install option for "RPi Camera Surveillance (DietPi-Cam)" DietPi-Software | Changed PHP-apc/u conf files to remove "( 3 days )". It was causing php errors line 4. +DietPi-Config > Advanced | Better explanation of swapfile. +Added changelog | *waves* Code Related: -DietPi-Software | Seperated internal install flags for Webserver. Allows for applications to be installed that require only parts of the LAMP stack. +DietPi-Software | Separated internal install flags for Webserver. Allows for applications to be installed that require only parts of the LAMP stack. /func/ | Change_hostname is now a global function script /boot/dietpi/conf/index.php has changed to phpinfo.php. Allows us to reserve index.php for other software. diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7ed519f2fc..aaeb82bf6b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -77,6 +77,7 @@ SMBSERVER=0 VPNSERVER=0 OPENTYRIAN=0 + DIETPICAM_MASTER=0 #Linux Software INSTALL_LINUX_CHOICESMADE=false @@ -121,6 +122,7 @@ echo -e "SMBSERVER $SMBSERVER" >> /boot/dietpi/.installed echo -e "VPNSERVER $VPNSERVER" >> /boot/dietpi/.installed echo -e "OPENTYRIAN $OPENTYRIAN" >> /boot/dietpi/.installed + echo -e "DIETPICAM_MASTER $DIETPICAM_MASTER" >> /boot/dietpi/.installed echo -e "#Additional Linux Software" >> /boot/dietpi/.installed echo -e "VIMFULL $VIMFULL" >> /boot/dietpi/.installed @@ -157,6 +159,7 @@ SMBSERVER=$(cat /boot/dietpi/.installed | grep 'SMBSERVER ' | awk '{print $2}') VPNSERVER=$(cat /boot/dietpi/.installed | grep 'VPNSERVER ' | awk '{print $2}') OPENTYRIAN=$(cat /boot/dietpi/.installed | grep 'OPENTYRIAN ' | awk '{print $2}') + DIETPICAM_MASTER=$(cat /boot/dietpi/.installed | grep 'DIETPICAM_MASTER ' | awk '{print $2}') #Linux VIMFULL=$(cat /boot/dietpi/.installed | grep 'VIMFULL ' | awk '{print $2}') @@ -198,14 +201,14 @@ PROFTP=1 fi - # Installs that require WEBSERVER_LAMP (WEBSERVER_APACHE / WEBSERVER_MYSQL / WEBSERVER_PHP / WEBSERVER_PHPMYADMIN) + # Installs that require WEBSERVER_LAMP if (( $OWNCLOUD == 1 )); then WEBSERVER_LAMP=1 elif (( $PHPBB == 1 )); then WEBSERVER_LAMP=1 fi - #define extra DietPi flags for WEBSERVER_LAMP (WEBSERVER_APACHE / WEBSERVER_MYSQL / WEBSERVER_PHP / WEBSERVER_PHPMYADMIN) + #Define extra DietPi install flags for WEBSERVER_LAMP (WEBSERVER_APACHE + WEBSERVER_MYSQL + WEBSERVER_PHP + WEBSERVER_PHPMYADMIN) if (( $WEBSERVER_LAMP == 1 )); then WEBSERVER_APACHE=1 WEBSERVER_MYSQL=1 @@ -213,6 +216,11 @@ WEBSERVER_PHPMYADMIN=1 fi + #DietPiCam | Installs that require WEBSERVER_APACHE + WEBSERVER_PHP + if (( $DIETPICAM_MASTER == 1 )); then + WEBSERVER_APACHE=1 + WEBSERVER_PHP=1 + fi #-------------------------------------------------------------- #Install Software @@ -539,6 +547,56 @@ OPENTYRIAN=0 fi fi + + if (( $DIETPICAM_MASTER == 1 )); then + INSTALL_DESCRIPTION='RPi Camera Surveillance (DietPi-Cam)' + Banner_Installing + + #check source is online + INTERNET_ADDRESS='https://github.com/Fourdee/RPi_Cam_Web_Interface/archive/master.zip' + /boot/dietpi/func/check_connection 5 2 "$INTERNET_ADDRESS" + + #Install + if (( $? == 0 )); then + + #Install pre-reqs + apt-get install gpac motion zip -y + + #Get source/binaries and extract + wget https://github.com/Fourdee/RPi_Cam_Web_Interface/archive/master.zip + unzip master.zip + rm master.zip + + #work form inside RPi_Cam folder + cd RPi_Cam* + + #Setup /var/www/dietpicam + mkdir -p /var/www/dietpicam/media + cp -R www/* /var/www/dietpicam/ + chmod +x /var/www/dietpicam/raspizip.sh + mknod /var/www/dietpicam/FIFO p + mknod /var/www/dietpicam/FIFO1 p + + #Temp cam.jpg file symlink + ln -sf /run/shm/mjpeg/cam.jpg /var/www/dietpicam/cam.jpg + + #Setup Raspimjpeg binary + cp bin/raspimjpeg /opt/vc/bin/raspimjpeg + chmod +x /opt/vc/bin/raspimjpeg + ln -s /opt/vc/bin/raspimjpeg /usr/bin/raspimjpeg + + #Cleanup / remove extracted source + cd ~/ + rm -R ~/RPi_Cam* + + else + Info_NoConnection_NoInstall + + #Abort Install, prevent configs being applied + DIETPICAM_MASTER=0 + fi + + fi } Install_Linux_Software(){ @@ -709,8 +767,6 @@ #WEBSERVER_LAMP if (( $WEBSERVER_LAMP == 1 )); then - #mkdir -p /var/www - #chown -R www-data:www-data /var/www WEBSERVER_LAMP=2 fi @@ -1071,6 +1127,42 @@ OPENTYRIAN=2 fi + + if (( $DIETPICAM_MASTER == 1 )); then + + #raspimjpeg Conf + cp /boot/dietpi/conf/dietpicam_raspimjpeg /etc/raspimjpeg + chmod +x /etc/raspimjpeg + ln -s /etc/raspimjpeg /var/www/dietpicam/raspimjpeg + + #raspimjpeg/php schedule startup and control script + cp /boot/dietpi/conf/dietpicam_raspimjpeg_init /etc/raspimjpeg_init + chmod +x /etc/raspimjpeg_init + + #Motion config file + mkdir -p /etc/motion + cp /boot/dietpi/conf/dietpicam_motion /etc/motion/motion.conf + chgrp www-data /etc/motion/motion.conf + chmod 777 /etc/motion/motion.conf + usermod -a -G video www-data + + #Set web permissions for dietpicam base directory + chown -R www-data:www-data /var/www/dietpicam + + #usbdrive install, create symlink to new data location. + if (( $USBDRIVE > 0 )); then + + rm -R /var/www/dietpicam/media + mkdir -p /mnt/usb_1/dietpicam/cam_master + ln -s /mnt/usb_1/dietpicam/cam_master /var/www/dietpicam/media + chown -R www-data:www-data /mnt/usb_1/dietpicam/cam_master + fi + + #Enable RPi Camera module + sed -i '/start_x=/c\start_x=1' /boot/config.txt + + DIETPICAM_MASTER=2 + fi #Apply GPU Memory Splits Install_Apply_Memory_Split @@ -1489,7 +1581,17 @@ OPENTYRIAN=0 fi fi + + local dietpicam_master_w="off" + if (( $DIETPICAM_MASTER > 0 )); then + dietpicam_master_w="on" + #Reset to 0. Menu checklists will apply back to 1 + if (( $DIETPICAM_MASTER == 1 )); then + DIETPICAM_MASTER=0 + fi + fi + #----------------------------------------------------------------------------- #Odroid C1 Software Installation if (( $HW_MODEL == 10 )); then WHIP_TITLE='DietPi - Software Selection' @@ -1503,6 +1605,7 @@ "12" "File Server (Samba)" $smbserver_w \ "13" "VPN Server (SoftEther)" $vpnserver_w \ "14" "Website URL Address (No-Ip)" $noipdyndns_w 2>results + #----------------------------------------------------------------------------- #Rpi elif (( $HW_MODEL <= 2 )); then WHIP_TITLE='DietPi - Software Selection' @@ -1513,14 +1616,15 @@ "4" "Gaming (OpenTyrian Game)" $opentyrian_w \ "5" "BitTorrent (Transmission)" $transmission_w \ "6" "OwnCloud" $owncloud_w \ - "7" "DLNA/UPnP Media Server (MiniDLNA)" $minidlna_w \ + "7" "DLNA / UPnP Media Server (MiniDLNA)" $minidlna_w \ "8" "HiFi / Web Interface Music Player (Mpd Ympd)" $ympd_w \ "9" "Forums (PHPBB)" $phpbb_w \ "10" "WebServer (Apache2/mysql/php5/phpmyadmin)" $webserver_lamp_w \ "11" "FTP Server (Proftp)" $proftp_w \ "12" "File Server (Samba)" $smbserver_w \ "13" "VPN Server (SoftEther)" $vpnserver_w \ - "14" "Website URL Address (No-Ip)" $noipdyndns_w 2>results + "14" "Website URL Address (No-Ip)" $noipdyndns_w \ + "15" "RPi Camera Surveillance (DietPi-Cam)" $dietpicam_master_w 2>results fi while read choice @@ -1618,13 +1722,19 @@ INSTALL_DIETPI_CHOICESMADE=true fi ;; + 15) + if (( $DIETPICAM_MASTER == 0 )); then + DIETPICAM_MASTER=1 + INSTALL_DIETPI_CHOICESMADE=true + fi + ;; esac - #done < results - #rm results - done - + done < results + rm results + #----------------------------------------------------------------------------- #Install Info/Warnings + #oDroid c1 if (( $HW_MODEL == 10 )); then echo -e "Nothing here" @@ -1645,9 +1755,11 @@ fi fi + #----------------------------------------------------------------------------- #Update Install file Write_InstallFileList + #----------------------------------------------------------------------------- #Boot Choices local bootchoices_available=false if (( $DESKTOP == 1 )); then diff --git a/dietpi/patch_file b/dietpi/patch_file index 86ce0307a4..93fe3b4ece 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -111,6 +111,7 @@ #/boot/dietpi/conf/index.php has changed to phpinfo.php. Allows us to reserve index.php for other software. #Apply to hostsystem if [ -f /var/www/index.php ]; then + #Check its our file if (( $(cat /var/www/index.php | grep -ci -m1 'phpinfo()') == 1 )); then rm /var/www/index.php @@ -128,6 +129,10 @@ elif (( $DISTRO == 2 )); then sed -i "/apc.ttl=/c\apc.ttl=259200" /etc/php5/apache2/conf.d/20-apcu.ini fi + + #Add DietPiCam master to .installed + echo -e "DIETPICAM_MASTER 0" >> /boot/dietpi/.installed + fi sleep 2 From 88151c873ac4fc142d7647e311add1fa88509621 Mon Sep 17 00:00:00 2001 From: Fourdee Date: Mon, 11 May 2015 09:21:56 +0100 Subject: [PATCH 08/14] v54 DietPi-Software | Added DietPi optimized install option for "RPi Camera Surveillance (DietPi-Cam)" DietPi-Software | Added additional Linux software install option for "FTP Client Filesystem Mount (curlftpfs)". Can be setup using dietpi-config > networking. DietPi-Update | Added gitbranch option in dietpi.txt (gitbranch=master). This can be used to test the update/patching system. --- CHANGELOG.txt | 5 +- dietpi.txt | 8 +++ dietpi/conf/dietpicam_raspimjpeg | 3 +- dietpi/conf/fstab | 3 +- dietpi/conf/fstab_ubuntu | 3 +- dietpi/dietpi-config | 111 ++++++++++++++++++++++++++++--- dietpi/dietpi-software | 67 ++++++++++++++----- dietpi/dietpi-update | 28 ++++---- dietpi/patch_file | 33 ++++++++- 9 files changed, 215 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 702102967f..7be41266f0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,12 +1,15 @@ v54 Release Notes: DietPi-Software | Added DietPi optimized install option for "RPi Camera Surveillance (DietPi-Cam)" -DietPi-Software | Changed PHP-apc/u conf files to remove "( 3 days )". It was causing php errors line 4. +DietPi-Software | Added additional Linux software install option for "FTP Client Filesystem Mount (curlftpfs)". Can be configured using dietpi-config > networking. DietPi-Config > Advanced | Better explanation of swapfile. +DietPi-Config > Networking | Setting up a samba client share will no longer reset the /etc/fstab file each time. Added changelog | *waves* Code Related: +DietPi-Update | Added gitbranch option in dietpi.txt (gitbranch=master). This can be used to test the update/patching system. DietPi-Software | Separated internal install flags for Webserver. Allows for applications to be installed that require only parts of the LAMP stack. +DietPi-Software | Changed PHP-apc/u conf files to remove "( 3 days )". It was causing php errors line 4. /func/ | Change_hostname is now a global function script /boot/dietpi/conf/index.php has changed to phpinfo.php. Allows us to reserve index.php for other software. diff --git a/dietpi.txt b/dietpi.txt index 5d8b5ad3ca..294f1cf975 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -49,3 +49,11 @@ SambaClient_ComputerName=computername SambaClient_ShareName=sharename SambaClient_Username=username SambaClient_Password=password + +#FTP Client Filesystem Mount (CurlFtpFs) Details (Used by DietPi-Config | Networking | FTP Client) +curlftpfs_clientaddress=192.168.0.100 +curlftpfs_clientusername=root +curlftpfs_clientpassword=raspberry + +#Git Branch, DO NOT MODIFY +gitbranch=master \ No newline at end of file diff --git a/dietpi/conf/dietpicam_raspimjpeg b/dietpi/conf/dietpicam_raspimjpeg index 685eca0d5f..6d9a3312a0 100644 --- a/dietpi/conf/dietpicam_raspimjpeg +++ b/dietpi/conf/dietpicam_raspimjpeg @@ -114,5 +114,4 @@ watchdog_errors 3 user_config /var/www/dietpicam/uconfig #logfile for raspimjpeg, default to merge with scheduler log -#log_file /var/www/dietpicam/scheduleLog.txt -log_file /var/log/dietpicam_raspimjpeg +log_file /var/www/dietpicam/scheduleLog.txt diff --git a/dietpi/conf/fstab b/dietpi/conf/fstab index 82e7c6ca02..4ccb0d52ca 100644 --- a/dietpi/conf/fstab +++ b/dietpi/conf/fstab @@ -15,4 +15,5 @@ proc /proc proc defaults 0 0 #Samba Client------------------------------------------------------ #//servername/sharename /mnt/samba cifs username=msusername,password=mspassword,iocharset=utf8,sec=ntlm 0 0 -#DietPi-ConfigSambaClient replaced when using dietpi-config, networking, samba setup +#FTP Client------------------------------------------------------ +#curlftpfs#root:raspberry@192.168.0.100 /mnt/ftp_client fuse auto,user,uid=1000 0 0 diff --git a/dietpi/conf/fstab_ubuntu b/dietpi/conf/fstab_ubuntu index 51a5f5aeb7..0be34c4024 100644 --- a/dietpi/conf/fstab_ubuntu +++ b/dietpi/conf/fstab_ubuntu @@ -16,4 +16,5 @@ tmpfs /tmp tmpfs nodev,nosuid,mode=1777 0 0 #Samba Client------------------------------------------------------ #//servername/sharename /mnt/samba cifs username=msusername,password=mspassword,iocharset=utf8,sec=ntlm 0 0 -#DietPi-ConfigSambaClient replaced when using dietpi-config, networking, samba setup +#FTP Client------------------------------------------------------ +#curlftpfs#root:raspberry@192.168.0.100 /mnt/ftp_client fuse auto,user,uid=1000 0 0 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 7abfe564d0..7a8e063466 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1211,7 +1211,9 @@ samba_clientpassword=$OPTION #Unmount if connected - umount /mnt/samba + clear + echo -e "\n\n Attempting mount, please wait...." + umount /mnt/samba &> /dev/null #Save to Dietpi.txt sed -i "/SambaClient_ComputerName/c\SambaClient_ComputerName=$samba_clientname" /boot/dietpi.txt @@ -1223,21 +1225,68 @@ #Debian if (( $DISTRO == 1 )); then - cp /boot/dietpi/conf/fstab /etc/fstab - sed -i "/#DietPi-ConfigSambaClient/c\\/\/$samba_clientname\/$samba_clientshare \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm 0 0" /etc/fstab + sed -i "/\/mnt\/samba/c\\/\/$samba_clientname\/$samba_clientshare \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm 0 0" /etc/fstab #Ubuntu elif (( $DISTRO == 2 )); then - cp /boot/dietpi/conf/fstab_ubuntu /etc/fstab - sed -i "/#DietPi-ConfigSambaClient/c\\/\/$samba_clientname\/$samba_clientshare \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm,nobootwait 0 0" /etc/fstab + sed -i "/\/mnt\/samba/c\\/\/$samba_clientname\/$samba_clientshare \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm,nobootwait 0 0" /etc/fstab fi #Mount up - mount -a + mount -a &> /dev/null fi fi fi fi } + + Menu_CurlftpFsSetup(){ + + local curlftpfs_clientaddress=$(cat /boot/dietpi.txt | grep 'curlftpfs_clientaddress' | sed 's/curlftpfs_clientaddress=//g') + local curlftpfs_clientusername=$(cat /boot/dietpi.txt | grep 'curlftpfs_clientusername' | sed 's/curlftpfs_clientusername=//g') + local curlftpfs_clientpassword=$(cat /boot/dietpi.txt | grep 'curlftpfs_clientpassword' | sed 's/curlftpfs_clientpassword=//g') + OPTION=$(whiptail --inputbox "Please enter the FTP server URL or IP Address" 8 60 "$curlftpfs_clientaddress" --title "CurlFTPfs Setup" 3>&1 1>&2 2>&3) + CHOICE=$? + if (( $CHOICE == 0 )); then + curlftpfs_clientaddress=$OPTION + + #Username + OPTION=$(whiptail --inputbox "Please enter your FTP Login Username" 8 60 "$curlftpfs_clientusername" --title "CurlFTPfs Setup" 3>&1 1>&2 2>&3) + CHOICE=$? + if (( $CHOICE == 0 )); then + curlftpfs_clientusername=$OPTION + + #Password + OPTION=$(whiptail --inputbox "Please enter your FTP Login Password \n - (NOTICE) This will be stored with no encryption" 8 60 "$curlftpfs_clientpassword" --title "CurlFTPfs Setup" 3>&1 1>&2 2>&3) + CHOICE=$? + if (( $CHOICE == 0 )); then + curlftpfs_clientpassword=$OPTION + + #Unmount if connected + clear + echo -e "\n\n Attempting mount, please wait...." + umount /mnt/ftp_client &> /dev/null + + #Save to Dietpi.txt + sed -i "/curlftpfs_clientaddress/c\curlftpfs_clientaddress=$curlftpfs_clientaddress" /boot/dietpi.txt + sed -i "/curlftpfs_clientusername/c\curlftpfs_clientusername=$curlftpfs_clientusername" /boot/dietpi.txt + sed -i "/curlftpfs_clientpassword/c\curlftpfs_clientpassword=$curlftpfs_clientpassword" /boot/dietpi.txt + + #Apply to fstab + + #Debian + if (( $DISTRO == 1 )); then + sed -i "/\/mnt\/ftp_client/c\curlftpfs#$curlftpfs_clientusername:$curlftpfs_clientpassword@$curlftpfs_clientaddress \/mnt\/ftp_client fuse auto,user,uid=1000 0 0" /etc/fstab + #Ubuntu + elif (( $DISTRO == 2 )); then + sed -i "/\/mnt\/ftp_client/c\curlftpfs#$curlftpfs_clientusername:$curlftpfs_clientpassword@$curlftpfs_clientaddress \/mnt\/ftp_client fuse auto,user,uid=1000,nobootwait 0 0" /etc/fstab + fi + + #Mount up + mount -a &> /dev/null + fi + fi + fi + } #TARGETMENUID=8 Menu_NetworkOptions(){ @@ -1318,6 +1367,23 @@ fi fi + #ftp Client mount, curlftpfs + local curlftpfs_installed=0 + local curlftpfs_status="Not Installed" + local curlftpfs_menutext="Install now to access FTP as filesystem mount" + if (( $(cat /boot/dietpi/.installed | grep 'CURLFTPFS' | awk '{print $2}') == 2 )); then + + curlftpfs_installed=1 + curlftpfs_status="Unable to connect and/or incorrect details" + curlftpfs_menutext="Input/Modify Details" + + #Check if mount exists and is valid + if (( $(df -h | grep -ci -m1 '/mnt/ftp_client') == 1 )); then + #Get stats + curlftpfs_status="/mnt/ftp_client | Connected" + fi + fi + #NoIp Client local noip_installed=0 local noip_status="Not Installed" @@ -1337,11 +1403,12 @@ WHIP_TITLE='--- DietPi - Network Options ---' - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " \n Ethernet : $eth0_hardware_text | $eth0_disabled_text | $eth0_connected_text \n Wifi : $wlan0_hardware_text | $wlan0_disabled_text | $wlan0_connected_text \n Internet : $Internet_connected_text \n Samba : $sambaclient_status \n NoIp : $noip_status" --cancel-button "Back" --backtitle "$WHIP_BACKTITLE" 19 75 5 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " \n Ethernet : $eth0_hardware_text | $eth0_disabled_text | $eth0_connected_text \n Wifi : $wlan0_hardware_text | $wlan0_disabled_text | $wlan0_connected_text \n Internet : $Internet_connected_text \n Samba client : $sambaclient_status \n FTP client : $curlftpfs_status\n NoIp status : $noip_status" --cancel-button "Back" --backtitle "$WHIP_BACKTITLE" 20 75 6 \ "Ethernet" "Change Wired Network Settings" \ "Wifi" "Change Wireless Network Settings" \ "Test" "Run the Internet Connection Test" \ - "Samba" "$sambaclient_menutext" \ + "Samba Client" "$sambaclient_menutext" \ + "Ftp Client" "$curlftpfs_menutext" \ "NoIp" "$noip_menutext" 3>&1 1>&2 2>&3) case "$OPTION" in @@ -1419,13 +1486,37 @@ apt-get update apt-get install smbclient cifs-utils ntfs-3g -y --no-install-recommends - #Update DietPi .installed - sed -i '/SMBCLIENT/c\SMBCLIENT 2' /boot/dietpi/.installed + #Check its installed. Update DietPi .installed + if (( $(dpkg -l | grep -ci -m1 'smbclient') == 1 )); then + sed -i '/SMBCLIENT/c\SMBCLIENT 2' /boot/dietpi/.installed + fi fi else Menu_SambaClientSetup fi + #Return to this Menu + TARGETMENUID=8 + ;; + Ftp*) + #Installed? + if (( $curlftpfs_installed == 0 )); then + whiptail --title "FTP Client Not Installed" --yesno " FTP Client (curlftpfs) is not installed, would you like to install it now? \n \n - This is required to mount a FTP connection as filesystem" --defaultno --yes-button "Install" --no-button "Abort" --backtitle "$WHIP_BACKTITLE" 14 60 + CHOICE=$? + if (( $CHOICE == 0 )); then + #install curlftpfs + apt-get update + apt-get install curlftpfs -y + + #Check its installed. Update DietPi .installed + if (( $(dpkg -l | grep -ci -m1 'curlftpfs') == 1 )); then + sed -i '/CURLFTPFS/c\CURLFTPFS 2' /boot/dietpi/.installed + fi + fi + else + Menu_CurlftpFsSetup + fi + #Return to this Menu TARGETMENUID=8 ;; diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index aaeb82bf6b..341c757a9f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -89,6 +89,7 @@ BUILDESSENTIAL=0 ALSABASE=0 XSERVERXORG=0 + CURLFTPFS=0 Write_InstallFileList_AbortChanges(){ @@ -133,6 +134,7 @@ echo -e "BUILDESSENTIAL $BUILDESSENTIAL" >> /boot/dietpi/.installed echo -e "ALSABASE $ALSABASE" >> /boot/dietpi/.installed echo -e "XSERVERXORG $XSERVERXORG" >> /boot/dietpi/.installed + echo -e "CURLFTPFS $CURLFTPFS" >> /boot/dietpi/.installed } @@ -170,6 +172,7 @@ BUILDESSENTIAL=$(cat /boot/dietpi/.installed | grep 'BUILDESSENTIAL ' | awk '{print $2}') ALSABASE=$(cat /boot/dietpi/.installed | grep 'ALSABASE ' | awk '{print $2}') XSERVERXORG=$(cat /boot/dietpi/.installed | grep 'XSERVERXORG ' | awk '{print $2}') + CURLFTPFS=$(cat /boot/dietpi/.installed | grep 'CURLFTPFS ' | awk '{print $2}') #Take note of the extra space used at the end of each grep quote 'MYSOFTWARE ' #This ensures packages with similar names (eg: WEBSERVER_PHP and WEBSERVER_PHPMYADMIN) dont both get picked up. @@ -714,6 +717,13 @@ XSERVERXORG=2 fi + if (( $CURLFTPFS == 1 )); then + INSTALL_DESCRIPTION='FTP Client Filesystem Mount (curlftpfs)' + Banner_Installing + apt-get install curlftpfs -y + + CURLFTPFS=2 + fi } Install_Apply_Configs(){ @@ -1152,10 +1162,15 @@ #usbdrive install, create symlink to new data location. if (( $USBDRIVE > 0 )); then - rm -R /var/www/dietpicam/media mkdir -p /mnt/usb_1/dietpicam/cam_master + rm -R /var/www/dietpicam/media ln -s /mnt/usb_1/dietpicam/cam_master /var/www/dietpicam/media chown -R www-data:www-data /mnt/usb_1/dietpicam/cam_master + #create symlink to user folder + else + mkdir -p ~/dietpicam/cam_master + ln -s ~/dietpicam/cam_master /var/www/dietpicam/media + chown -R www-data:www-data ~/dietpicam/cam_master fi #Enable RPi Camera module @@ -1164,8 +1179,6 @@ DIETPICAM_MASTER=2 fi - #Apply GPU Memory Splits - Install_Apply_Memory_Split } Install_Apply_Memory_Split(){ @@ -1874,6 +1887,17 @@ XSERVERXORG=0 fi fi + + #CURLFTPFS + local curlftpfs_w="off" + if (( $CURLFTPFS > 0 )); then + curlftpfs_w="on" + #Reset to 0. Menu checklists will apply back to 1 + if (( $CURLFTPFS == 1 )); then + CURLFTPFS=0 + fi + fi + #Odroid C1 Software Installation if (( $HW_MODEL == 10 )); then @@ -1882,10 +1906,11 @@ "1" "Vim" $vimfull_w \ "2" "OpenSSH Client" $sshclient_w \ "3" "Samba Client (Access Windows Network Shares)" $smbclient_w \ - "5" "Build-Essentials" $buildessential_w \ - "6" "Git" $gitclient_w \ - "7" "ALSA (Sound)" $alsabase_w \ - "8" "Xserver / Xinit / Xauth(Display)" $xserverxorg_w 2>results + "4" "FTP Client Filesystem Mount (curlftpfs)" $curlftpfs_w \ + "6" "Build-Essentials" $buildessential_w \ + "7" "Git" $gitclient_w \ + "8" "ALSA (Sound)" $alsabase_w \ + "9" "Xserver / Xinit / Xauth(Display)" $xserverxorg_w 2>results #Rpi elif (( $HW_MODEL <= 2 )); then @@ -1894,11 +1919,12 @@ "1" "Vim" $vimfull_w \ "2" "OpenSSH Client" $sshclient_w \ "3" "Samba Client (Access Windows Network Shares)" $smbclient_w \ - "4" "RPi.GPIO (GPIO Projects)" $rpigpio_w \ - "5" "Build-Essentials" $buildessential_w \ - "6" "Git" $gitclient_w \ - "7" "ALSA (Sound)" $alsabase_w \ - "8" "Xserver / Xinit / Xauth / fbturbo (Display)" $xserverxorg_w 2>results + "4" "FTP Client Filesystem Mount (curlftpfs)" $curlftpfs_w \ + "5" "RPi.GPIO (GPIO Projects)" $rpigpio_w \ + "6" "Build-Essentials" $buildessential_w \ + "7" "Git" $gitclient_w \ + "8" "ALSA (Sound)" $alsabase_w \ + "9" "Xserver / Xinit / Xauth / fbturbo (Display)" $xserverxorg_w 2>results fi while read choice @@ -1923,30 +1949,36 @@ fi ;; 4) + if (( $CURLFTPFS == 0 )); then + CURLFTPFS=1 + INSTALL_LINUX_CHOICESMADE=true + fi + ;; + 5) if (( $RPIGPIO == 0 )); then RPIGPIO=1 INSTALL_LINUX_CHOICESMADE=true fi ;; - 5) + 6) if (( $BUILDESSENTIAL == 0 )); then BUILDESSENTIAL=1 INSTALL_LINUX_CHOICESMADE=true fi ;; - 6) + 7) if (( $GITCLIENT == 0 )); then GITCLIENT=1 INSTALL_LINUX_CHOICESMADE=true fi ;; - 7) + 8) if (( $ALSABASE == 0 )); then ALSABASE=1 INSTALL_LINUX_CHOICESMADE=true fi ;; - 8) + 9) if (( $XSERVERXORG == 0 )); then XSERVERXORG=1 INSTALL_LINUX_CHOICESMADE=true @@ -2161,6 +2193,9 @@ Banner_Configs Install_Apply_Configs + #Apply GPU Memory Splits + Install_Apply_Memory_Split + #Write .Install File Write_InstallFileList diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 1e3869e12b..20098c99ca 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -16,7 +16,12 @@ # - dietpi-update 1 = forced update #//////////////////////////////////// INPUT=$1 - + + #///////////////////////////////////////////////////////////////////////////////////// + #GIT Branch | master + #///////////////////////////////////////////////////////////////////////////////////// + GITBRANCH=(cat /boot/dietpi.txt | grep 'gitbranch' | sed 's/gitbranch=//g') + #///////////////////////////////////////////////////////////////////////////////////// #Obtain Hardware Details #///////////////////////////////////////////////////////////////////////////////////// @@ -69,19 +74,18 @@ Run_DietPi_Update(){ #Remove any previous cloned files - rm -R ~/DietPi-master &> /dev/null + rm -R ~/DietPi-* &> /dev/null #git clone Zip method (no longer need to install GIT) - wget https://github.com/Fourdee/DietPi/archive/master.zip - unzip master.zip - rm master.zip + wget https://github.com/Fourdee/DietPi/archive/"$GITBRANCH".zip + unzip "$GITBRANCH".zip + rm "$GITBRANCH".zip #Remove Files from git that are not to be updated - rm ~/DietPi-master/dietpi/.* &> /dev/null - #rm ~/DietPi-master/dietpi/dietpi-update &> /dev/null + rm ~/DietPi-"$GITBRANCH"/dietpi/.* &> /dev/null #Copy to Fat16/32 partition - cp -Rf ~/DietPi-master/dietpi /boot + cp -Rf ~/DietPi-"$GITBRANCH"/dietpi /boot #Run Patch file while (( $VERSION_CURRENT < $VERSION_SERVER )); do @@ -105,7 +109,7 @@ rm /boot/dietpi/server_version &> /dev/null #Remove temp files - rm -R ~/DietPi-master &> /dev/null + rm -R ~/DietPi-"$GITBRANCH" &> /dev/null RUN_UPDATE=false @@ -120,8 +124,8 @@ #Get Local Version Get_Current_Version - #Check Server is online - /boot/dietpi/func/check_connection 5 2 https://github.com + #Check gitbranch is online + /boot/dietpi/func/check_connection 5 2 https://raw.githubusercontent.com/Fourdee/DietPi/"$GITBRANCH"/dietpi/server_version if (( $? == 0 )); then SERVER_ONLINE=true @@ -129,7 +133,7 @@ cd ~/ #Get server version file - wget https://raw.githubusercontent.com/Fourdee/DietPi/master/dietpi/server_version + wget https://raw.githubusercontent.com/Fourdee/DietPi/"$GITBRANCH"/dietpi/server_version #Get server Version info VERSION_SERVER=$(sed -n 1p ~/server_version) diff --git a/dietpi/patch_file b/dietpi/patch_file index 93fe3b4ece..52129300d3 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -92,6 +92,7 @@ elif (( $VERSION_CURRENT == 53 )); then echo -e "53 > 54 patch" + #------------------------------------------------------------------------------- #WEBSERVER install flag has changed to split system. patch host .installed file. if [ -f /boot/dietpi/.installed ]; then @@ -108,6 +109,29 @@ echo -e "WEBSERVER_PHPMYADMIN $temp_value" >> /boot/dietpi/.installed fi + #------------------------------------------------------------------------------- + #New install flags + if [ -f /boot/dietpi/.installed ]; then + #New install options for DietPi optimized software + echo -e "DIETPICAM_MASTER 0" >> /boot/dietpi/.installed + + #New install options for linux software + echo -e "CURLFTPFS 0" >> /boot/dietpi/.installed + fi + + #Add template curlftpfs mount to fstab (to be used with dietpi-config) + echo -e "\n#FTP Client------------------------------------------------------" >> /etc/fstab + echo -e "#curlftpfs#root:raspberry@192.168.0.100 /mnt/ftp_client fuse auto,user,uid=1000 0 0" >> /etc/fstab + #create a mount folder + mkdir -p /mnt/ftp_client + #Add to dietpi.txt + echo -e "\n#FTP Client Filesystem Mount (CurlFtpFs) Details (Used by DietPi-Config | Networking | FTP Client)" >> /boot/dietpi.txt + echo -e "curlftpfs_clientaddress=192.168.0.100" >> /boot/dietpi.txt + echo -e "curlftpfs_clientusername=root" >> /boot/dietpi.txt + echo -e "curlftpfs_clientpassword=raspberry" >> /boot/dietpi.txt + + + #------------------------------------------------------------------------------- #/boot/dietpi/conf/index.php has changed to phpinfo.php. Allows us to reserve index.php for other software. #Apply to hostsystem if [ -f /var/www/index.php ]; then @@ -121,6 +145,7 @@ #Remove the old index.php from boot partition /dietpi/conf/ rm /boot/dietpi/conf/index.php + #------------------------------------------------------------------------------- #Modify PHP-apc/u conf file to remove "(3days)" .It was causing php errors line 4. #Debian if (( $DISTRO == 1 )); then @@ -130,9 +155,11 @@ sed -i "/apc.ttl=/c\apc.ttl=259200" /etc/php5/apache2/conf.d/20-apcu.ini fi - #Add DietPiCam master to .installed - echo -e "DIETPICAM_MASTER 0" >> /boot/dietpi/.installed - + #------------------------------------------------------------------------------- + #Add GitBranch option to dietpi.txt (for testing patching system) + echo -e "\n#Git Branch, DO NOT MODIFY" >> /boot/dietpi.txt + echo -e "gitbranch=master" >> /boot/dietpi.txt + fi sleep 2 From 75e08cc01a6d792986af81855e647e94c4909559 Mon Sep 17 00:00:00 2001 From: Fourdee Date: Mon, 11 May 2015 09:34:49 +0100 Subject: [PATCH 09/14] v54 Human error :8ball: --- dietpi/dietpi-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 20098c99ca..05fec85adf 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -20,7 +20,7 @@ #///////////////////////////////////////////////////////////////////////////////////// #GIT Branch | master #///////////////////////////////////////////////////////////////////////////////////// - GITBRANCH=(cat /boot/dietpi.txt | grep 'gitbranch' | sed 's/gitbranch=//g') + GITBRANCH=$(cat /boot/dietpi.txt | grep 'gitbranch' | sed 's/gitbranch=//g') #///////////////////////////////////////////////////////////////////////////////////// #Obtain Hardware Details From 8cedb30b48271c03ce307ff8c3390a62cafe91ab Mon Sep 17 00:00:00 2001 From: Fourdee Date: Tue, 12 May 2015 13:07:55 +0100 Subject: [PATCH 10/14] v54 Black screen exit kodi fix for rpi Finishing off dietpicam --- CHANGELOG.txt | 8 +- dietpi.txt | 16 +- dietpi/conf/desktop/.gtk-bookmarks | 1 + dietpi/conf/desktop/kodi.desktop | 22 +++ dietpi/conf/fstab | 2 +- dietpi/conf/fstab_ubuntu | 2 +- dietpi/dietpi-config | 104 +------------ dietpi/dietpi-software | 205 +++++++++++++++---------- dietpi/dietpi-update | 1 + dietpi/finalise | 1 + dietpi/func/dietpi-set_curlftpfs | 87 +++++++++++ dietpi/func/dietpi-set_smbclient | 94 ++++++++++++ dietpi/misc/rpi_kodi_noblackscreen_run | 32 ++++ dietpi/patch_file | 52 ++++++- 14 files changed, 440 insertions(+), 187 deletions(-) create mode 100644 dietpi/conf/desktop/kodi.desktop create mode 100644 dietpi/func/dietpi-set_curlftpfs create mode 100644 dietpi/func/dietpi-set_smbclient create mode 100644 dietpi/misc/rpi_kodi_noblackscreen_run diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7be41266f0..5a50c49b8f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,18 +1,22 @@ v54 Release Notes: -DietPi-Software | Added DietPi optimized install option for "RPi Camera Surveillance (DietPi-Cam)" -DietPi-Software | Added additional Linux software install option for "FTP Client Filesystem Mount (curlftpfs)". Can be configured using dietpi-config > networking. +DietPi-Software | Added DietPi optimized install option for "RPi Camera / Web Interface Surveillance (DietPi-Cam)" +DietPi-Software | Added additional Linux software install option for "FTP Client Filesystem Mount (curlftpfs)". Can be installed and configured using dietpi-config > networking. +DietPi-Software | Changed the DietPi optimized software menu to be more informative and user friendly. DietPi-Config > Advanced | Better explanation of swapfile. DietPi-Config > Networking | Setting up a samba client share will no longer reset the /etc/fstab file each time. +DietPi-Software > Kodi | Fixed black screen hangs on exit. If starting from console users must run startkodi. Desktop shortcuts have been patched. Added changelog | *waves* Code Related: DietPi-Update | Added gitbranch option in dietpi.txt (gitbranch=master). This can be used to test the update/patching system. DietPi-Software | Separated internal install flags for Webserver. Allows for applications to be installed that require only parts of the LAMP stack. DietPi-Software | Changed PHP-apc/u conf files to remove "( 3 days )". It was causing php errors line 4. +/func/ | Moved "set samba client details" from dietpi-config to /boot/dietpi/func/dietpi-set_smbclient /func/ | Change_hostname is now a global function script /boot/dietpi/conf/index.php has changed to phpinfo.php. Allows us to reserve index.php for other software. + ----------------------------------------------------------------------------------------------------------- v53 diff --git a/dietpi.txt b/dietpi.txt index 294f1cf975..7523099c23 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -56,4 +56,18 @@ curlftpfs_clientusername=root curlftpfs_clientpassword=raspberry #Git Branch, DO NOT MODIFY -gitbranch=master \ No newline at end of file +gitbranch=master + +#---------------------------------------------------------------- +# D I E T - P I +# Settings Specific to DietPi-Cam +#---------------------------------------------------------------- +#0=standalone 1=server 2=client +dietpicam_mode=0 + +#0 = FTP based system (proftpd server - curlftpfs) +#1 = SAMBA based system (smb server - smbclient +dietpicam_connection_mode=0 + +#Camera name to be used eg: dietpicam_name=TheGirlNextDoor +dietpicam_name=cam_1 diff --git a/dietpi/conf/desktop/.gtk-bookmarks b/dietpi/conf/desktop/.gtk-bookmarks index 35ca85bf85..99ec3cdf8e 100644 --- a/dietpi/conf/desktop/.gtk-bookmarks +++ b/dietpi/conf/desktop/.gtk-bookmarks @@ -2,3 +2,4 @@ file:/// / file:///root /root file:///mnt/usb_1 USB Drive file:///mnt/samba Samba Client +file:///mnt/ftp_client FTP Client \ No newline at end of file diff --git a/dietpi/conf/desktop/kodi.desktop b/dietpi/conf/desktop/kodi.desktop new file mode 100644 index 0000000000..c0d6a6d799 --- /dev/null +++ b/dietpi/conf/desktop/kodi.desktop @@ -0,0 +1,22 @@ +[Desktop Entry] +Version=1.0 +Name=Kodi Media Center +GenericName=Media Center +Comment=Manage and view your media +Exec=startkodi +Icon=kodi +Terminal=false +Type=Application +Categories=AudioVideo;Video;Player;TV; + +Actions=Fullscreen;Standalone; + +[Desktop Action Fullscreen] +Name=Open in fullscreen +Exec=startkodi +OnlyShowIn=Unity; + +[Desktop Action Standalone] +Name=Open in standalone mode +Exec=startkodi +OnlyShowIn=Unity; diff --git a/dietpi/conf/fstab b/dietpi/conf/fstab index 4ccb0d52ca..78fbbd83ff 100644 --- a/dietpi/conf/fstab +++ b/dietpi/conf/fstab @@ -16,4 +16,4 @@ proc /proc proc defaults 0 0 #//servername/sharename /mnt/samba cifs username=msusername,password=mspassword,iocharset=utf8,sec=ntlm 0 0 #FTP Client------------------------------------------------------ -#curlftpfs#root:raspberry@192.168.0.100 /mnt/ftp_client fuse auto,user,uid=1000 0 0 +#curlftpfs#root:raspberry@192.168.0.100 /mnt/ftp_client fuse auto,allow_other,direct_io,user,uid=1000 0 0 diff --git a/dietpi/conf/fstab_ubuntu b/dietpi/conf/fstab_ubuntu index 0be34c4024..e5bb7dfeba 100644 --- a/dietpi/conf/fstab_ubuntu +++ b/dietpi/conf/fstab_ubuntu @@ -17,4 +17,4 @@ tmpfs /tmp tmpfs nodev,nosuid,mode=1777 0 0 #//servername/sharename /mnt/samba cifs username=msusername,password=mspassword,iocharset=utf8,sec=ntlm 0 0 #FTP Client------------------------------------------------------ -#curlftpfs#root:raspberry@192.168.0.100 /mnt/ftp_client fuse auto,user,uid=1000 0 0 +#curlftpfs#root:raspberry@192.168.0.100 /mnt/ftp_client auto,allow_other,direct_io,user,uid=1000 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 7a8e063466..fa895f374e 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1184,108 +1184,12 @@ Menu_SambaClientSetup(){ - local samba_clientname=$(cat /boot/dietpi.txt | grep 'SambaClient_ComputerName' | sed 's/SambaClient_ComputerName=//g') - local samba_clientshare=$(cat /boot/dietpi.txt | grep 'SambaClient_ShareName' | sed 's/SambaClient_ShareName=//g') - local samba_clientusename=$(cat /boot/dietpi.txt | grep 'SambaClient_Username' | sed 's/SambaClient_Username=//g') - local samba_clientpassword=$(cat /boot/dietpi.txt | grep 'SambaClient_Password' | sed 's/SambaClient_Password=//g') - OPTION=$(whiptail --inputbox "Please enter your Windows Computer name or IP Address" 8 60 "$samba_clientname" --title "Samba Client Setup" 3>&1 1>&2 2>&3) - CHOICE=$? - if (( $CHOICE == 0 )); then - samba_clientname=$OPTION - - OPTION=$(whiptail --inputbox "Please enter your Windows Shared Folder Name" 8 60 "$samba_clientshare" --title "Samba Client Setup" 3>&1 1>&2 2>&3) - CHOICE=$? - if (( $CHOICE == 0 )); then - samba_clientshare=$OPTION - - #Username - OPTION=$(whiptail --inputbox "Please enter your Windows Share Username" 8 60 "$samba_clientusename" --title "Samba Client Setup" 3>&1 1>&2 2>&3) - CHOICE=$? - if (( $CHOICE == 0 )); then - samba_clientusename=$OPTION - - #Password - OPTION=$(whiptail --inputbox "Please enter your Windows Share Password \n - (NOTICE) This will be stored with no encryption" 8 60 "$samba_clientpassword" --title "Samba Client Setup" 3>&1 1>&2 2>&3) - CHOICE=$? - if (( $CHOICE == 0 )); then - samba_clientpassword=$OPTION - - #Unmount if connected - clear - echo -e "\n\n Attempting mount, please wait...." - umount /mnt/samba &> /dev/null - - #Save to Dietpi.txt - sed -i "/SambaClient_ComputerName/c\SambaClient_ComputerName=$samba_clientname" /boot/dietpi.txt - sed -i "/SambaClient_ShareName/c\SambaClient_ShareName=$samba_clientshare" /boot/dietpi.txt - sed -i "/SambaClient_Username/c\SambaClient_Username=$samba_clientusename" /boot/dietpi.txt - sed -i "/SambaClient_Password/c\SambaClient_Password=$samba_clientpassword" /boot/dietpi.txt - - #Apply to fstab - - #Debian - if (( $DISTRO == 1 )); then - sed -i "/\/mnt\/samba/c\\/\/$samba_clientname\/$samba_clientshare \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm 0 0" /etc/fstab - #Ubuntu - elif (( $DISTRO == 2 )); then - sed -i "/\/mnt\/samba/c\\/\/$samba_clientname\/$samba_clientshare \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm,nobootwait 0 0" /etc/fstab - fi - - #Mount up - mount -a &> /dev/null - fi - fi - fi - fi + /boot/dietpi/func/dietpi-set_smbclient } Menu_CurlftpFsSetup(){ - local curlftpfs_clientaddress=$(cat /boot/dietpi.txt | grep 'curlftpfs_clientaddress' | sed 's/curlftpfs_clientaddress=//g') - local curlftpfs_clientusername=$(cat /boot/dietpi.txt | grep 'curlftpfs_clientusername' | sed 's/curlftpfs_clientusername=//g') - local curlftpfs_clientpassword=$(cat /boot/dietpi.txt | grep 'curlftpfs_clientpassword' | sed 's/curlftpfs_clientpassword=//g') - OPTION=$(whiptail --inputbox "Please enter the FTP server URL or IP Address" 8 60 "$curlftpfs_clientaddress" --title "CurlFTPfs Setup" 3>&1 1>&2 2>&3) - CHOICE=$? - if (( $CHOICE == 0 )); then - curlftpfs_clientaddress=$OPTION - - #Username - OPTION=$(whiptail --inputbox "Please enter your FTP Login Username" 8 60 "$curlftpfs_clientusername" --title "CurlFTPfs Setup" 3>&1 1>&2 2>&3) - CHOICE=$? - if (( $CHOICE == 0 )); then - curlftpfs_clientusername=$OPTION - - #Password - OPTION=$(whiptail --inputbox "Please enter your FTP Login Password \n - (NOTICE) This will be stored with no encryption" 8 60 "$curlftpfs_clientpassword" --title "CurlFTPfs Setup" 3>&1 1>&2 2>&3) - CHOICE=$? - if (( $CHOICE == 0 )); then - curlftpfs_clientpassword=$OPTION - - #Unmount if connected - clear - echo -e "\n\n Attempting mount, please wait...." - umount /mnt/ftp_client &> /dev/null - - #Save to Dietpi.txt - sed -i "/curlftpfs_clientaddress/c\curlftpfs_clientaddress=$curlftpfs_clientaddress" /boot/dietpi.txt - sed -i "/curlftpfs_clientusername/c\curlftpfs_clientusername=$curlftpfs_clientusername" /boot/dietpi.txt - sed -i "/curlftpfs_clientpassword/c\curlftpfs_clientpassword=$curlftpfs_clientpassword" /boot/dietpi.txt - - #Apply to fstab - - #Debian - if (( $DISTRO == 1 )); then - sed -i "/\/mnt\/ftp_client/c\curlftpfs#$curlftpfs_clientusername:$curlftpfs_clientpassword@$curlftpfs_clientaddress \/mnt\/ftp_client fuse auto,user,uid=1000 0 0" /etc/fstab - #Ubuntu - elif (( $DISTRO == 2 )); then - sed -i "/\/mnt\/ftp_client/c\curlftpfs#$curlftpfs_clientusername:$curlftpfs_clientpassword@$curlftpfs_clientaddress \/mnt\/ftp_client fuse auto,user,uid=1000,nobootwait 0 0" /etc/fstab - fi - - #Mount up - mount -a &> /dev/null - fi - fi - fi + /boot/dietpi/func/dietpi-set_curlftpfs } #TARGETMENUID=8 @@ -1479,7 +1383,7 @@ Samba*) #Installed? if (( $sambaclient_installed == 0 )); then - whiptail --title "Samba Client Not Installed" --yesno " Samba Client is not installed, would you like to install it now? \n \n - This is required to access Windows Share Files" --defaultno --yes-button "Install" --no-button "Abort" --backtitle "$WHIP_BACKTITLE" 14 60 + whiptail --title "Samba Client Not Installed" --yesno " Samba Client is not installed, would you like to install it now? \n \n - This is required to access Windows Share Files" --defaultno --yes-button "Install" --no-button "Abort" --backtitle "$WHIP_BACKTITLE" 12 65 CHOICE=$? if (( $CHOICE == 0 )); then #install smbclient @@ -1501,7 +1405,7 @@ Ftp*) #Installed? if (( $curlftpfs_installed == 0 )); then - whiptail --title "FTP Client Not Installed" --yesno " FTP Client (curlftpfs) is not installed, would you like to install it now? \n \n - This is required to mount a FTP connection as filesystem" --defaultno --yes-button "Install" --no-button "Abort" --backtitle "$WHIP_BACKTITLE" 14 60 + whiptail --title "FTP Client Not Installed" --yesno " FTP Client (curlftpfs) is not installed, would you like to install it now? \n \n - This is required to mount an FTP connection to filesystem" --defaultno --yes-button "Install" --no-button "Abort" --backtitle "$WHIP_BACKTITLE" 12 65 CHOICE=$? if (( $CHOICE == 0 )); then #install curlftpfs diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 341c757a9f..175a7dc93b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -77,7 +77,7 @@ SMBSERVER=0 VPNSERVER=0 OPENTYRIAN=0 - DIETPICAM_MASTER=0 + DIETPICAM=0 #Linux Software INSTALL_LINUX_CHOICESMADE=false @@ -123,7 +123,7 @@ echo -e "SMBSERVER $SMBSERVER" >> /boot/dietpi/.installed echo -e "VPNSERVER $VPNSERVER" >> /boot/dietpi/.installed echo -e "OPENTYRIAN $OPENTYRIAN" >> /boot/dietpi/.installed - echo -e "DIETPICAM_MASTER $DIETPICAM_MASTER" >> /boot/dietpi/.installed + echo -e "DIETPICAM $DIETPICAM" >> /boot/dietpi/.installed echo -e "#Additional Linux Software" >> /boot/dietpi/.installed echo -e "VIMFULL $VIMFULL" >> /boot/dietpi/.installed @@ -161,7 +161,7 @@ SMBSERVER=$(cat /boot/dietpi/.installed | grep 'SMBSERVER ' | awk '{print $2}') VPNSERVER=$(cat /boot/dietpi/.installed | grep 'VPNSERVER ' | awk '{print $2}') OPENTYRIAN=$(cat /boot/dietpi/.installed | grep 'OPENTYRIAN ' | awk '{print $2}') - DIETPICAM_MASTER=$(cat /boot/dietpi/.installed | grep 'DIETPICAM_MASTER ' | awk '{print $2}') + DIETPICAM=$(cat /boot/dietpi/.installed | grep 'DIETPICAM ' | awk '{print $2}') #Linux VIMFULL=$(cat /boot/dietpi/.installed | grep 'VIMFULL ' | awk '{print $2}') @@ -220,7 +220,7 @@ fi #DietPiCam | Installs that require WEBSERVER_APACHE + WEBSERVER_PHP - if (( $DIETPICAM_MASTER == 1 )); then + if (( $DIETPICAM == 1 )); then WEBSERVER_APACHE=1 WEBSERVER_PHP=1 fi @@ -551,8 +551,8 @@ fi fi - if (( $DIETPICAM_MASTER == 1 )); then - INSTALL_DESCRIPTION='RPi Camera Surveillance (DietPi-Cam)' + if (( $DIETPICAM == 1 )); then + INSTALL_DESCRIPTION='RPi Camera / Web Interface Surveillance (DietPi-Cam)' Banner_Installing #check source is online @@ -596,7 +596,7 @@ Info_NoConnection_NoInstall #Abort Install, prevent configs being applied - DIETPICAM_MASTER=0 + DIETPICAM=0 fi fi @@ -704,13 +704,13 @@ if (( $HW_MODEL <= 2 )); then INSTALL_DESCRIPTION='Xserver / Xorg (fbturbo)' Banner_Installing - apt-get install xinit xauth xserver-xorg xfonts-base xserver-xorg-video-fbturbo xserver-xorg-video-fbdev --no-install-recommends -y + apt-get install xinit xauth xserver-xorg xfonts-base xserver-xorg-video-fbturbo xserver-xorg-video-fbdev x11-xserver-utils --no-install-recommends -y elif (( $HW_MODEL == 10 )); then INSTALL_DESCRIPTION='Xserver / Xorg (mali)' Banner_Installing #Mali is already on DietOdroid image - apt-get install xinit xauth xserver-xorg xfonts-base --no-install-recommends -y + apt-get install xinit xauth xserver-xorg xfonts-base x11-xserver-utils --no-install-recommends -y fi @@ -1009,7 +1009,8 @@ if (( $KODI == 1 )); then #odroid c1 if (( $HW_MODEL == 10 )); then - echo -e "x" + echo -e "alias startkodi='kodi'" >> /etc/bash.bashrc + #rpi elif (( $HW_MODEL <= 2 )); then #Remove Kodi user (Whilst waving) @@ -1024,6 +1025,18 @@ #Enable Dedicated PWM pll sed -i '/avoid_pwm_pll=/c\avoid_pwm_pll=0' /boot/config.txt + + #Copy kodi.desktop entries to menu + cp /boot/dietpi/conf/desktop/kodi.desktop /usr/share/applications/kodi.desktop + + #Create Desktop Folder SymLinks + mkdir -p ~/Desktop + ln -s /usr/share/applications/kodi.desktop ~/Desktop/kodi.desktop + + #Black Screen on exit fix + echo -e "alias startkodi='/boot/dietpi/misc/rpi_kodi_noblackscreen_run'" >> /etc/bash.bashrc + sed -i "/Exec=/c\Exec=startkodi" /usr/share/applications/kodi.desktop + fi KODI=2 @@ -1138,7 +1151,8 @@ OPENTYRIAN=2 fi - if (( $DIETPICAM_MASTER == 1 )); then + #DietPi-Cam + if (( $DIETPICAM == 1 )); then #raspimjpeg Conf cp /boot/dietpi/conf/dietpicam_raspimjpeg /etc/raspimjpeg @@ -1156,27 +1170,60 @@ chmod 777 /etc/motion/motion.conf usermod -a -G video www-data - #Set web permissions for dietpicam base directory + #Set web permissions for local dietpicam web directory chown -R www-data:www-data /var/www/dietpicam - #usbdrive install, create symlink to new data location. - if (( $USBDRIVE > 0 )); then + #-------------- Maybe move below to another script for configuring dietpicam's modes etc. + #get DietPi-Cam details/settings + local dietpicam_mode=$(cat /boot/dietpi.txt | grep 'dietpicam_mode=' | sed 's/dietpicam_mode=//g') + local dietpicam_name=$(cat /boot/dietpi.txt | grep 'dietpicam_name=' | sed 's/dietpicam_name=//g') + local dietpicam_connection_mode=$(cat /boot/dietpi.txt | grep 'dietpicam_connection_mode=' | sed 's/dietpicam_connection_mode=//g') + local dietpicam_data_directory='/dietpi/dietpicam' + + #Standalone / Server install + if (( $dietpicam_mode <= 1 )); then + + #usbdrive install + if (( $USBDRIVE > 0 )); then + dietpicam_data_directory='/mnt/usb_1/dietpicam' + fi - mkdir -p /mnt/usb_1/dietpicam/cam_master - rm -R /var/www/dietpicam/media - ln -s /mnt/usb_1/dietpicam/cam_master /var/www/dietpicam/media - chown -R www-data:www-data /mnt/usb_1/dietpicam/cam_master - #create symlink to user folder - else - mkdir -p ~/dietpicam/cam_master - ln -s ~/dietpicam/cam_master /var/www/dietpicam/media - chown -R www-data:www-data ~/dietpicam/cam_master + #Create data directories + mkdir -p "$dietpicam_data_directory" + + #Client Install (not yet implimented or functional) + elif (( $dietpicam_mode == 2 )); then + + if (( $dietpicam_connection_mode == 0 )); then + dietpicam_data_directory='/mnt/ftp_client/dietpicam' + + elif (( $dietpicam_connection_mode == 1 )); then + dietpicam_data_directory='/mnt/samba/dietpicam' + fi + fi + #Remove existing data folder to make way for its symlink + rm -R /var/www/dietpicam/media + + ## | CLIENTS MUST BE CONNECTED | + + #create symlink to data directory + ln -s "$dietpicam_data_directory" /var/www/dietpicam/media + + ##update filenames for /etc/raspimjpeg + #sed -i "/image_path /c\image_path /var/www/dietpicam/media/$dietpicam_name-im_%i_%Y%M%D_%h%m%s.jpg" /etc/raspimjpeg + #sed -i "/lapse_path /c\lapse_path /var/www/dietpicam/media/$dietpicam_name-tl_%i_%t_%Y%M%D_%h%m%s.jpg" /etc/raspimjpeg + #sed -i "/video_path /c\video_path /var/www/dietpicam/media/$dietpicam_name-vi_%v_%Y%M%D_%h%m%s.mp4" /etc/raspimjpeg + + #Set permissions to data directory + chown -R www-data:www-data "$dietpicam_data_directory" + chmod -R 777 "$dietpicam_data_directory" + #Enable RPi Camera module sed -i '/start_x=/c\start_x=1' /boot/config.txt - DIETPICAM_MASTER=2 + DIETPICAM=2 fi } @@ -1595,79 +1642,80 @@ fi fi - local dietpicam_master_w="off" - if (( $DIETPICAM_MASTER > 0 )); then - dietpicam_master_w="on" + local dietpicam_w="off" + if (( $DIETPICAM > 0 )); then + dietpicam_w="on" #Reset to 0. Menu checklists will apply back to 1 - if (( $DIETPICAM_MASTER == 1 )); then - DIETPICAM_MASTER=0 + if (( $DIETPICAM == 1 )); then + DIETPICAM=0 fi fi #----------------------------------------------------------------------------- #Odroid C1 Software Installation if (( $HW_MODEL == 10 )); then - WHIP_TITLE='DietPi - Software Selection' - whiptail --title "$WHIP_TITLE" --checklist --separate-output "Please Select the Software you wish to install \n - Press the SpaceBar to select/unselect" --backtitle "$WHIP_TITLE" 18 64 10 \ - "2" "Kodi / XBMC" $kodi_w \ - "5" "BitTorrent (Transmission)" $transmission_w \ - "6" "OwnCloud" $owncloud_w \ - "9" "Forums (PHPBB)" $phpbb_w \ - "10" "WebServer (Apache2/mysql/php5/phpmyadmin)" $webserver_lamp_w \ - "11" "FTP Server (Proftp)" $proftp_w \ - "12" "File Server (Samba)" $smbserver_w \ - "13" "VPN Server (SoftEther)" $vpnserver_w \ - "14" "Website URL Address (No-Ip)" $noipdyndns_w 2>results + WHIP_TITLE='DietPi Optimized Software Selection' + whiptail --title "$WHIP_TITLE" --checklist --separate-output "Please Select the Software you wish to install \n - Press the SpaceBar to select/unselect" --backtitle "$WHIP_TITLE" 18 72 10 \ + "Kodi" "Your very own media centre/player." $kodi_w \ + "Transmission" "BitTorrent server with web interface." $transmission_w \ + "OwnCloud" "Your very own cloud (eg: dropbox)." $owncloud_w \ + "Forums" "Your very own website forums (Phpbb3)." $phpbb_w \ + "Webserver" "LAMPP (Apache2/mysql/php5/phpmyadmin)." $webserver_lamp_w \ + "Proftp" "FTP server (lightweight)." $proftp_w \ + "Samba" "File server." $smbserver_w \ + "SoftEther" "VPN server." $vpnserver_w \ + "NoIp" "URL website address for your device." $noipdyndns_w 2>results + #----------------------------------------------------------------------------- #Rpi elif (( $HW_MODEL <= 2 )); then - WHIP_TITLE='DietPi - Software Selection' - whiptail --title "$WHIP_TITLE" --checklist --separate-output "Please Select the Software you wish to install \n - Press the SpaceBar to select/unselect" --backtitle "$WHIP_TITLE" 18 70 10 \ - "1" "Desktop (LXDE)" $desktop_w \ - "2" "Kodi / XBMC (Michael Gorven Repo)" $kodi_w \ - "3" "Gaming (RetroPie)" $retropie_w \ - "4" "Gaming (OpenTyrian Game)" $opentyrian_w \ - "5" "BitTorrent (Transmission)" $transmission_w \ - "6" "OwnCloud" $owncloud_w \ - "7" "DLNA / UPnP Media Server (MiniDLNA)" $minidlna_w \ - "8" "HiFi / Web Interface Music Player (Mpd Ympd)" $ympd_w \ - "9" "Forums (PHPBB)" $phpbb_w \ - "10" "WebServer (Apache2/mysql/php5/phpmyadmin)" $webserver_lamp_w \ - "11" "FTP Server (Proftp)" $proftp_w \ - "12" "File Server (Samba)" $smbserver_w \ - "13" "VPN Server (SoftEther)" $vpnserver_w \ - "14" "Website URL Address (No-Ip)" $noipdyndns_w \ - "15" "RPi Camera Surveillance (DietPi-Cam)" $dietpicam_master_w 2>results + WHIP_TITLE='DietPi Optimized Software Selection' + whiptail --title "$WHIP_TITLE" --checklist --separate-output "Please use the spacebar to select the software you wish to install.\nSoftware details: http://fuzon.co.uk/phpbb/viewtopic.php?f=8&t=5" --backtitle "$WHIP_TITLE" 20 75 12 \ + "Desktop" "LXDE: Ultra lightweight desktop." $desktop_w \ + "Kodi" "Your very own media centre / player." $kodi_w \ + "RetroPie" "Gaming: Turn your RPi into a gaming system." $retropie_w \ + "OpenTyrian" "Gaming: A classic retro game, addictive." $opentyrian_w \ + "Transmission" "BitTorrent server with web interface." $transmission_w \ + "OwnCloud" "Your very own cloud (eg: dropbox)." $owncloud_w \ + "DietPiCam" "RPi Cam Control / Web Interface Surveillance." $dietpicam_w \ + "MiniDLNA" "Media streaming server (DLNA, UPnP)." $minidlna_w \ + "HiFi" "Web interface music / radio player." $ympd_w \ + "Forums" "Your very own website forums (Phpbb3)." $phpbb_w \ + "Webserver" "LAMP (Apache2/mysql/php5/phpmyadmin)." $webserver_lamp_w \ + "Proftp" "Lightweight FTP and file server." $proftp_w \ + "Samba" "File server." $smbserver_w \ + "SoftEther" "VPN server." $vpnserver_w \ + "NoIp" "URL website address for your device." $noipdyndns_w 2>results fi while read choice do case $choice in - 1) + Desktop) if (( $DESKTOP == 0 )); then DESKTOP=1 INSTALL_DIETPI_CHOICESMADE=true fi ;; - 2) + Kodi) if (( $KODI == 0 )); then KODI=1 INSTALL_DIETPI_CHOICESMADE=true fi ;; - 3) + RetroPie) if (( $RETROPIE == 0 )); then RETROPIE=1 INSTALL_DIETPI_CHOICESMADE=true fi ;; - 4) + OpenTyrian) if (( $OPENTYRIAN == 0 )); then OPENTYRIAN=1 INSTALL_DIETPI_CHOICESMADE=true fi ;; - 5) + Transmission) if (( $USBDRIVE > 0 )); then if (( $TRANSMISSION == 0 )); then TRANSMISSION=1 @@ -1677,7 +1725,7 @@ Info_UsbDrive_Required "BitTorrent" fi ;; - 6) + OwnCloud) if (( $USBDRIVE > 0 )); then if (( $OWNCLOUD == 0 )); then OWNCLOUD=1 @@ -1687,60 +1735,60 @@ Info_UsbDrive_Required "OwnCloud" fi ;; - 7) + DietPiCam) + if (( $DIETPICAM == 0 )); then + DIETPICAM=1 + INSTALL_DIETPI_CHOICESMADE=true + fi + ;; + MiniDLNA) if (( $MINIDLNA == 0 )); then MINIDLNA=1 INSTALL_DIETPI_CHOICESMADE=true fi ;; - 8) + HiFi) if (( $YMPD == 0 )); then YMPD=1 INSTALL_DIETPI_CHOICESMADE=true fi ;; - 9) + Forums) if (( $PHPBB == 0 )); then PHPBB=1 INSTALL_DIETPI_CHOICESMADE=true fi ;; - 10) + Webserver) if (( $WEBSERVER_LAMP == 0 )); then WEBSERVER_LAMP=1 INSTALL_DIETPI_CHOICESMADE=true fi ;; - 11) + Proftp) if (( $PROFTP == 0 )); then PROFTP=1 INSTALL_DIETPI_CHOICESMADE=true fi ;; - 12) + Samba) if (( $SMBSERVER == 0 )); then SMBSERVER=1 INSTALL_DIETPI_CHOICESMADE=true fi ;; - 13) + SoftEther) if (( $VPNSERVER == 0 )); then VPNSERVER=1 INSTALL_DIETPI_CHOICESMADE=true fi ;; - 14) + NoIp) if (( $NOIPDYNDNS == 0 )); then NOIPDYNDNS=1 INSTALL_DIETPI_CHOICESMADE=true fi ;; - 15) - if (( $DIETPICAM_MASTER == 0 )); then - DIETPICAM_MASTER=1 - INSTALL_DIETPI_CHOICESMADE=true - fi - ;; esac done < results rm results @@ -1899,6 +1947,7 @@ fi + #----------------------------------------------------------------------------- #Odroid C1 Software Installation if (( $HW_MODEL == 10 )); then WHIP_TITLE='Linux - Software Selection' @@ -1911,6 +1960,7 @@ "7" "Git" $gitclient_w \ "8" "ALSA (Sound)" $alsabase_w \ "9" "Xserver / Xinit / Xauth(Display)" $xserverxorg_w 2>results + #----------------------------------------------------------------------------- #Rpi elif (( $HW_MODEL <= 2 )); then @@ -1988,6 +2038,7 @@ done < results rm results + #----------------------------------------------------------------------------- #Update Install file Write_InstallFileList diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 05fec85adf..8cf50eaf80 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -156,6 +156,7 @@ elif (( $VERSION_CURRENT < $VERSION_SERVER )); then #Forced update + #if [ "$INPUT" = "1" ]; then if (( $INPUT == 1 )); then clear /boot/dietpi/dietpi-banner 0 diff --git a/dietpi/finalise b/dietpi/finalise index 9437b41af4..2f65673f10 100644 --- a/dietpi/finalise +++ b/dietpi/finalise @@ -145,6 +145,7 @@ /boot/dietpi/dietpi-cpu_set # Development Settings + sed -i "/gitbranch=/c\gitbranch=master" /boot/dietpi.txt #//////////////////////////////////// # Remove/Reset DietPi generated files diff --git a/dietpi/func/dietpi-set_curlftpfs b/dietpi/func/dietpi-set_curlftpfs new file mode 100644 index 0000000000..de48a12162 --- /dev/null +++ b/dietpi/func/dietpi-set_curlftpfs @@ -0,0 +1,87 @@ +#!/bin/bash +{ + #//////////////////////////////////// + # DietPi Function: + # - Setup and apply DietPi curlftpfs details + # + #//////////////////////////////////// + # Created by Dan Knight / daniel_haze@hotmail.com / fuzon.co.uk + # + #//////////////////////////////////// + # + # Info: + # - Used to change curlftpfs details stored in dietpi.txt. + # - Applies details to /etc/fstab + # - Mounts to /mnt/ftp_client if successful + # - no exit code return, or status. + # + # Usage: + # - /boot/dietpi/func/dietpi-set_curlftpfs + #//////////////////////////////////// + + #///////////////////////////////////////////////////////////////////////////////////// + #Obtain Pi/Odroid Model and distro + #///////////////////////////////////////////////////////////////////////////////////// + HW_MODEL=$(sed -n 1p /boot/dietpi/.hw_model) + HW_MODEL_DESCRIPTION=$(sed -n 2p /boot/dietpi/.hw_model) + DISTRO=$(sed -n 3p /boot/dietpi/.hw_model) + + #///////////////////////////////////////////////////////////////////////////////////// + #curlftpfs data + #///////////////////////////////////////////////////////////////////////////////////// + OPTION=0 + CHOICE=0 + curlftpfs_clientaddress=$(cat /boot/dietpi.txt | grep 'curlftpfs_clientaddress' | sed 's/curlftpfs_clientaddress=//g') + curlftpfs_clientusername=$(cat /boot/dietpi.txt | grep 'curlftpfs_clientusername' | sed 's/curlftpfs_clientusername=//g') + curlftpfs_clientpassword=$(cat /boot/dietpi.txt | grep 'curlftpfs_clientpassword' | sed 's/curlftpfs_clientpassword=//g') + + #///////////////////////////////////////////////////////////////////////////////////// + # Main Loop + #///////////////////////////////////////////////////////////////////////////////////// + OPTION=$(whiptail --inputbox "Please enter the FTP server URL or IP Address" 8 60 "$curlftpfs_clientaddress" --title "CurlFTPfs Setup" 3>&1 1>&2 2>&3) + CHOICE=$? + if (( $CHOICE == 0 )); then + curlftpfs_clientaddress=$OPTION + + #Username + OPTION=$(whiptail --inputbox "Please enter your FTP Login Username" 8 60 "$curlftpfs_clientusername" --title "CurlFTPfs Setup" 3>&1 1>&2 2>&3) + CHOICE=$? + if (( $CHOICE == 0 )); then + curlftpfs_clientusername=$OPTION + + #Password + OPTION=$(whiptail --inputbox "Please enter your FTP Login Password \n - (NOTICE) This will be stored with no encryption" 8 60 "$curlftpfs_clientpassword" --title "CurlFTPfs Setup" 3>&1 1>&2 2>&3) + CHOICE=$? + if (( $CHOICE == 0 )); then + curlftpfs_clientpassword=$OPTION + + #Unmount if connected + clear + echo -e "\n\n Attempting mount, please wait...." + umount /mnt/ftp_client &> /dev/null + + #Save to Dietpi.txt + sed -i "/curlftpfs_clientaddress/c\curlftpfs_clientaddress=$curlftpfs_clientaddress" /boot/dietpi.txt + sed -i "/curlftpfs_clientusername/c\curlftpfs_clientusername=$curlftpfs_clientusername" /boot/dietpi.txt + sed -i "/curlftpfs_clientpassword/c\curlftpfs_clientpassword=$curlftpfs_clientpassword" /boot/dietpi.txt + + #Apply to fstab + + #Debian + if (( $DISTRO == 1 )); then + sed -i "/\/mnt\/ftp_client/c\curlftpfs#$curlftpfs_clientusername:$curlftpfs_clientpassword@$curlftpfs_clientaddress \/mnt\/ftp_client fuse auto,allow_other,direct_io,transform_symlinks,user,uid=1000 0 0" /etc/fstab + #Ubuntu + elif (( $DISTRO == 2 )); then + sed -i "/\/mnt\/ftp_client/c\curlftpfs#$curlftpfs_clientusername:$curlftpfs_clientpassword@$curlftpfs_clientaddress \/mnt\/ftp_client fuse auto,allow_other,direct_io,transform_symlinks,user,uid=1000,nobootwait 0 0" /etc/fstab + fi + + #Mount up + mount -a &> /dev/null + + fi + fi + fi + + #exit + exit +} \ No newline at end of file diff --git a/dietpi/func/dietpi-set_smbclient b/dietpi/func/dietpi-set_smbclient new file mode 100644 index 0000000000..d9e7f4a230 --- /dev/null +++ b/dietpi/func/dietpi-set_smbclient @@ -0,0 +1,94 @@ +#!/bin/bash +{ + #//////////////////////////////////// + # DietPi Function: + # - Setup and apply DietPi smbclient details + # + #//////////////////////////////////// + # Created by Dan Knight / daniel_haze@hotmail.com / fuzon.co.uk + # + #//////////////////////////////////// + # + # Info: + # - Used to change smbclient details stored in dietpi.txt. + # - Applies details to /etc/fstab + # - Mounts to /mnt/samba if successful + # - no exit code return, or status. + # + # Usage: + # - /boot/dietpi/func/dietpi-set_smbclient + #//////////////////////////////////// + + #///////////////////////////////////////////////////////////////////////////////////// + #Obtain Pi/Odroid Model and distro + #///////////////////////////////////////////////////////////////////////////////////// + HW_MODEL=$(sed -n 1p /boot/dietpi/.hw_model) + HW_MODEL_DESCRIPTION=$(sed -n 2p /boot/dietpi/.hw_model) + DISTRO=$(sed -n 3p /boot/dietpi/.hw_model) + + #///////////////////////////////////////////////////////////////////////////////////// + #smbclient data + #///////////////////////////////////////////////////////////////////////////////////// + OPTION=0 + CHOICE=0 + samba_clientname=$(cat /boot/dietpi.txt | grep 'SambaClient_ComputerName' | sed 's/SambaClient_ComputerName=//g') + samba_clientshare=$(cat /boot/dietpi.txt | grep 'SambaClient_ShareName' | sed 's/SambaClient_ShareName=//g') + samba_clientusename=$(cat /boot/dietpi.txt | grep 'SambaClient_Username' | sed 's/SambaClient_Username=//g') + samba_clientpassword=$(cat /boot/dietpi.txt | grep 'SambaClient_Password' | sed 's/SambaClient_Password=//g') + + #///////////////////////////////////////////////////////////////////////////////////// + # Main Loop + #///////////////////////////////////////////////////////////////////////////////////// + OPTION=$(whiptail --inputbox "Please enter your Windows Computer name or IP Address" 8 60 "$samba_clientname" --title "Samba Client Setup" 3>&1 1>&2 2>&3) + CHOICE=$? + if (( $CHOICE == 0 )); then + samba_clientname=$OPTION + + OPTION=$(whiptail --inputbox "Please enter your Windows Shared Folder Name" 8 60 "$samba_clientshare" --title "Samba Client Setup" 3>&1 1>&2 2>&3) + CHOICE=$? + if (( $CHOICE == 0 )); then + samba_clientshare=$OPTION + + #Username + OPTION=$(whiptail --inputbox "Please enter your Windows Share Username" 8 60 "$samba_clientusename" --title "Samba Client Setup" 3>&1 1>&2 2>&3) + CHOICE=$? + if (( $CHOICE == 0 )); then + samba_clientusename=$OPTION + + #Password + OPTION=$(whiptail --inputbox "Please enter your Windows Share Password \n - (NOTICE) This will be stored with no encryption" 8 60 "$samba_clientpassword" --title "Samba Client Setup" 3>&1 1>&2 2>&3) + CHOICE=$? + if (( $CHOICE == 0 )); then + samba_clientpassword=$OPTION + + #Unmount if connected + clear + echo -e "\n\n Attempting mount, please wait...." + umount /mnt/samba &> /dev/null + + #Save to Dietpi.txt + sed -i "/SambaClient_ComputerName/c\SambaClient_ComputerName=$samba_clientname" /boot/dietpi.txt + sed -i "/SambaClient_ShareName/c\SambaClient_ShareName=$samba_clientshare" /boot/dietpi.txt + sed -i "/SambaClient_Username/c\SambaClient_Username=$samba_clientusename" /boot/dietpi.txt + sed -i "/SambaClient_Password/c\SambaClient_Password=$samba_clientpassword" /boot/dietpi.txt + + #Apply to fstab + + #Debian + if (( $DISTRO == 1 )); then + sed -i "/\/mnt\/samba/c\\/\/$samba_clientname\/$samba_clientshare \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm 0 0" /etc/fstab + #Ubuntu + elif (( $DISTRO == 2 )); then + sed -i "/\/mnt\/samba/c\\/\/$samba_clientname\/$samba_clientshare \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm,nobootwait 0 0" /etc/fstab + fi + + #Mount up + mount -a &> /dev/null + fi + fi + fi + fi + + #exit + exit +} \ No newline at end of file diff --git a/dietpi/misc/rpi_kodi_noblackscreen_run b/dietpi/misc/rpi_kodi_noblackscreen_run new file mode 100644 index 0000000000..0b2f792d27 --- /dev/null +++ b/dietpi/misc/rpi_kodi_noblackscreen_run @@ -0,0 +1,32 @@ +#!/bin/bash +{ + #//////////////////////////////////// + # DietPi RPi Kodi run script: + # + # + #//////////////////////////////////// + # Created by Dan Knight / daniel_haze@hotmail.com / fuzon.co.uk + # + #//////////////////////////////////// + # + # Info: + # - Runs Kodi + # - Fixes black screen hangs when exiting Kodi + # - Resets framebuffer depth and refreshes X after Kodi exits. + # + # Usage: + # - /boot/dietpi/misc/rpi_kodi_noblackscreen_run + # - startkodi (if alias is created in /etc/bash.bashrc) + #//////////////////////////////////// + + #///////////////////////////////////////////////////////////////////////////////////// + # Main Loop + #///////////////////////////////////////////////////////////////////////////////////// + kodi-standalone + fbset -depth 8 &> /dev/null + fbset -depth 16 &> /dev/null + xrefresh &> /dev/null + + #exit + exit +} \ No newline at end of file diff --git a/dietpi/patch_file b/dietpi/patch_file index 52129300d3..35f7857587 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -97,7 +97,7 @@ if [ -f /boot/dietpi/.installed ]; then #Get current installed state value - temp_value=$(cat /boot/dietpi/.installed | grep 'WEBSERVER' | awk '{print $2}') + temp_value=$(cat /boot/dietpi/.installed | grep 'WEBSERVER ' | awk '{print $2}') #Change WEBSERVER to WEBSERVER_LAMP sed -i "/WEBSERVER/c\WEBSERVER_LAMP $temp_value" /boot/dietpi/.installed @@ -113,7 +113,7 @@ #New install flags if [ -f /boot/dietpi/.installed ]; then #New install options for DietPi optimized software - echo -e "DIETPICAM_MASTER 0" >> /boot/dietpi/.installed + echo -e "DIETPICAM 0" >> /boot/dietpi/.installed #New install options for linux software echo -e "CURLFTPFS 0" >> /boot/dietpi/.installed @@ -130,7 +130,6 @@ echo -e "curlftpfs_clientusername=root" >> /boot/dietpi.txt echo -e "curlftpfs_clientpassword=raspberry" >> /boot/dietpi.txt - #------------------------------------------------------------------------------- #/boot/dietpi/conf/index.php has changed to phpinfo.php. Allows us to reserve index.php for other software. #Apply to hostsystem @@ -149,10 +148,10 @@ #Modify PHP-apc/u conf file to remove "(3days)" .It was causing php errors line 4. #Debian if (( $DISTRO == 1 )); then - sed -i "/apc.ttl=/c\apc.ttl=259200" /etc/php5/apache2/conf.d/20-apc.ini + sed -i "/apc.ttl=/c\apc.ttl=259200" /etc/php5/apache2/conf.d/20-apc.ini &> /dev/null #Ubuntu elif (( $DISTRO == 2 )); then - sed -i "/apc.ttl=/c\apc.ttl=259200" /etc/php5/apache2/conf.d/20-apcu.ini + sed -i "/apc.ttl=/c\apc.ttl=259200" /etc/php5/apache2/conf.d/20-apcu.ini &> /dev/null fi #------------------------------------------------------------------------------- @@ -160,6 +159,49 @@ echo -e "\n#Git Branch, DO NOT MODIFY" >> /boot/dietpi.txt echo -e "gitbranch=master" >> /boot/dietpi.txt + #------------------------------------------------------------------------------- + #Add settings for DietPiCam to dietpi.txt + echo -e "\n#----------------------------------------------------------------" >> /boot/dietpi.txt + echo -e "# D I E T - P I" >> /boot/dietpi.txt + echo -e "# Settings Specific to DietPi-Cam" >> /boot/dietpi.txt + echo -e "#----------------------------------------------------------------" >> /boot/dietpi.txt + echo -e "#0=standalone 1=server 2=client" >> /boot/dietpi.txt + echo -e "dietpicam_mode=0" >> /boot/dietpi.txt + echo -e "\n#0 = FTP based system (proftpd server - curlftpfs)" >> /boot/dietpi.txt + echo -e "#1 = SAMBA based system (smb server - smbclient " >> /boot/dietpi.txt + echo -e "dietpicam_connection_mode=0" >> /boot/dietpi.txt + echo -e "\n#Camera name to be used eg: dietpicam_name=bedroom or dietpicam_name=TheGirlNextDoot" >> /boot/dietpi.txt + echo -e "dietpicam_name=cam_1" >> /boot/dietpi.txt + echo -e "" >> /boot/dietpi.txt + echo -e "" >> /boot/dietpi.txt + echo -e "" >> /boot/dietpi.txt + echo -e "" >> /boot/dietpi.txt + + #------------------------------------------------------------------------------- + #Add x11-xserver-utils to xserver installs (xrefresh used to apply kodi fix for rpi) + if (( $(cat /boot/dietpi/.installed | grep 'XSERVERXORG ' | awk '{print $2}') == 2 )); then + apt-get install x11-xserver-utils -y + fi + + #------------------------------------------------------------------------------- + #RPI kodi changes + if (( $DISTRO == 1 )) && (( $(cat /boot/dietpi/.installed | grep 'KODI ' | awk '{print $2}') == 2 )); then + #Copy kodi.desktop entries to menu + cp /boot/dietpi/conf/desktop/kodi.desktop /usr/share/applications/kodi.desktop + + #Create Desktop Folder SymLinks + mkdir -p ~/Desktop + ln -s /usr/share/applications/kodi.desktop ~/Desktop/kodi.desktop + + #Black Screen on exit fix + echo -e "alias startkodi='/boot/dietpi/misc/rpi_kodi_noblackscreen_run'" >> /etc/bash.bashrc + sed -i "/Exec=/c\Exec=startkodi" /usr/share/applications/kodi.desktop + fi + #------------------------------------------------------------------------------- + #Add /mnt/ftp_client to .gtkbookmarks for pcmanfm fav links + if (( $(cat /boot/dietpi/.installed | grep 'DESKTOP' | awk '{print $2}') == 2 )); then + echo -e "file:///mnt/ftp_client FTP Client" >> ~/.gtk-bookmarks + fi fi sleep 2 From 7f074bc04b3b16ba4cd7a70472d026f7d0b320e9 Mon Sep 17 00:00:00 2001 From: Fourdee Date: Tue, 12 May 2015 13:17:25 +0100 Subject: [PATCH 11/14] v54 updated info --- CHANGELOG.txt | 2 +- dietpi/dietpi-software | 9 ++++----- dietpi/patch_file | 19 +++++++++++-------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5a50c49b8f..5a7541d9ff 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,9 +3,9 @@ Release Notes: DietPi-Software | Added DietPi optimized install option for "RPi Camera / Web Interface Surveillance (DietPi-Cam)" DietPi-Software | Added additional Linux software install option for "FTP Client Filesystem Mount (curlftpfs)". Can be installed and configured using dietpi-config > networking. DietPi-Software | Changed the DietPi optimized software menu to be more informative and user friendly. +DietPi-Software > Kodi | Fixed black screen hangs on exit. If starting from console users must run startkodi. Desktop shortcuts have been patched. DietPi-Config > Advanced | Better explanation of swapfile. DietPi-Config > Networking | Setting up a samba client share will no longer reset the /etc/fstab file each time. -DietPi-Software > Kodi | Fixed black screen hangs on exit. If starting from console users must run startkodi. Desktop shortcuts have been patched. Added changelog | *waves* Code Related: diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 175a7dc93b..a6ade9b73a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1033,12 +1033,11 @@ mkdir -p ~/Desktop ln -s /usr/share/applications/kodi.desktop ~/Desktop/kodi.desktop - #Black Screen on exit fix - echo -e "alias startkodi='/boot/dietpi/misc/rpi_kodi_noblackscreen_run'" >> /etc/bash.bashrc - sed -i "/Exec=/c\Exec=startkodi" /usr/share/applications/kodi.desktop - fi - + + #startkodi alias (fix black screen exit script). Also use as a run alias for all other DISTROs + echo -e "alias startkodi='/boot/dietpi/misc/rpi_kodi_noblackscreen_run'" >> /etc/bash.bashrc + KODI=2 fi diff --git a/dietpi/patch_file b/dietpi/patch_file index 35f7857587..2258718591 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -185,17 +185,20 @@ #------------------------------------------------------------------------------- #RPI kodi changes - if (( $DISTRO == 1 )) && (( $(cat /boot/dietpi/.installed | grep 'KODI ' | awk '{print $2}') == 2 )); then - #Copy kodi.desktop entries to menu - cp /boot/dietpi/conf/desktop/kodi.desktop /usr/share/applications/kodi.desktop + if (( $(cat /boot/dietpi/.installed | grep 'KODI ' | awk '{print $2}') == 2 )); then + + #rpi/debian + if (( $DISTRO == 1 )); then + #Copy new kodi.desktop entries to menu + cp /boot/dietpi/conf/desktop/kodi.desktop /usr/share/applications/kodi.desktop - #Create Desktop Folder SymLinks - mkdir -p ~/Desktop - ln -s /usr/share/applications/kodi.desktop ~/Desktop/kodi.desktop + #Create Desktop Folder SymLinks + mkdir -p ~/Desktop + ln -s /usr/share/applications/kodi.desktop ~/Desktop/kodi.desktop + fi - #Black Screen on exit fix + #Black Screen on exit fix. Also use as a run alias for all other DISTROs echo -e "alias startkodi='/boot/dietpi/misc/rpi_kodi_noblackscreen_run'" >> /etc/bash.bashrc - sed -i "/Exec=/c\Exec=startkodi" /usr/share/applications/kodi.desktop fi #------------------------------------------------------------------------------- #Add /mnt/ftp_client to .gtkbookmarks for pcmanfm fav links From 568e759cc9ff3bf7690171eaec23bfbb9c13321a Mon Sep 17 00:00:00 2001 From: Fourdee Date: Tue, 12 May 2015 13:19:25 +0100 Subject: [PATCH 12/14] v54 changlog date added for v54 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5a7541d9ff..438d627a18 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,5 @@ v54 +(12/05/15) Release Notes: DietPi-Software | Added DietPi optimized install option for "RPi Camera / Web Interface Surveillance (DietPi-Cam)" DietPi-Software | Added additional Linux software install option for "FTP Client Filesystem Mount (curlftpfs)". Can be installed and configured using dietpi-config > networking. From 76250b38dcffacf30a62293895739ad79c7d21ff Mon Sep 17 00:00:00 2001 From: Fourdee Date: Tue, 12 May 2015 13:32:53 +0100 Subject: [PATCH 13/14] v54 gpl additional documentation --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index d051763429..64f87d5480 100644 --- a/README.md +++ b/README.md @@ -115,3 +115,6 @@ SoftEther VPN Server OpenTyrian - https://bitbucket.org/opentyrian/opentyrian/wiki/Home + +DietPiCam +- https://github.com/Fourdee/RPi_Cam_Web_Interface From f0f3f112e2b4693b9b3bceaec0f423a04fa81930 Mon Sep 17 00:00:00 2001 From: Fourdee Date: Tue, 12 May 2015 13:47:39 +0100 Subject: [PATCH 14/14] v54 finishing up. --- dietpi/dietpi-software | 4 +++- dietpi/finalise | 5 +++++ dietpi/patch_file | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a6ade9b73a..17c09a12e4 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1036,7 +1036,9 @@ fi #startkodi alias (fix black screen exit script). Also use as a run alias for all other DISTROs - echo -e "alias startkodi='/boot/dietpi/misc/rpi_kodi_noblackscreen_run'" >> /etc/bash.bashrc + if (( $(cat /etc/bash.bashrc | grep -ci -m1 'startkodi') == 0 )); then + echo -e "alias startkodi='/boot/dietpi/misc/rpi_kodi_noblackscreen_run'" >> /etc/bash.bashrc + fi KODI=2 fi diff --git a/dietpi/finalise b/dietpi/finalise index 2f65673f10..90bc709a17 100644 --- a/dietpi/finalise +++ b/dietpi/finalise @@ -147,6 +147,11 @@ # Development Settings sed -i "/gitbranch=/c\gitbranch=master" /boot/dietpi.txt + #DietPiCam Settings + sed -i "/dietpicam_mode=/c\dietpicam_mode=0" /boot/dietpi.txt + sed -i "/dietpicam_connection_mode=/c\dietpicam_connection_mode=0" /boot/dietpi.txt + sed -i "/dietpicam_name=/c\dietpicam_name=cam_1" /boot/dietpi.txt + #//////////////////////////////////// # Remove/Reset DietPi generated files rm /boot/dietpi/.* diff --git a/dietpi/patch_file b/dietpi/patch_file index 2258718591..1a49c5f125 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -200,11 +200,13 @@ #Black Screen on exit fix. Also use as a run alias for all other DISTROs echo -e "alias startkodi='/boot/dietpi/misc/rpi_kodi_noblackscreen_run'" >> /etc/bash.bashrc fi + #------------------------------------------------------------------------------- #Add /mnt/ftp_client to .gtkbookmarks for pcmanfm fav links if (( $(cat /boot/dietpi/.installed | grep 'DESKTOP' | awk '{print $2}') == 2 )); then echo -e "file:///mnt/ftp_client FTP Client" >> ~/.gtk-bookmarks fi + fi sleep 2