Skip to content
This repository has been archived by the owner on Feb 6, 2019. It is now read-only.

Commit

Permalink
add sheepit CLI module
Browse files Browse the repository at this point in the history
  • Loading branch information
zocker-160 committed May 30, 2018
1 parent 3c853b3 commit eb1bcd4
Show file tree
Hide file tree
Showing 8 changed files with 269 additions and 0 deletions.
1 change: 1 addition & 0 deletions porteus/modules/sheepit-module-CLI/etc/HOSTNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sheepitOS
71 changes: 71 additions & 0 deletions porteus/modules/sheepit-module-CLI/etc/inittab
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#
# inittab This file describes how the INIT process should set up
# the system in a certain run-level.
#
# Version: @(#)inittab 2.04 17/05/93 MvS
# 2.10 02/10/95 PV
# 3.00 02/06/1999 PV
# 4.00 04/10/2002 PV
# 13.37 2011-03-25 PJV
#
# Author: Miquel van Smoorenburg, <[email protected]>
# Modified by: Patrick J. Volkerding, <[email protected]>
#

# These are the default runlevels in Slackware:
# 0 = halt
# 1 = single user mode
# 2 = unused (but configured the same as runlevel 3)
# 3 = multiuser mode (default Slackware runlevel)
# 4 = X11 with KDM/GDM/XDM (session managers)
# 5 = unused (but configured the same as runlevel 3)
# 6 = reboot

# Default runlevel. (Do not set to 0 or 6)
id:3:initdefault:

# System initialization (runs when system boots).
si:S:sysinit:/etc/rc.d/rc.S

# Script to run when going single user (runlevel 1).
su:1S:wait:/etc/rc.d/rc.K

# Script to run when going multi user.
rc:2345:wait:/etc/rc.d/rc.M

# What to do at the "Three Finger Salute".
ca::ctrlaltdel:/sbin/shutdown -t5 -r now

# Runlevel 0 halts the system.
l0:0:wait:/etc/rc.d/rc.0

# Runlevel 6 reboots the system.
l6:6:wait:/etc/rc.d/rc.6

# What to do when power fails.
pf::powerfail:/sbin/genpowerfail start

# If power is back, cancel the running shutdown.
pg::powerokwait:/sbin/genpowerfail stop

# These are the standard console login getties in multiuser mode:
c1:12345:respawn:/sbin/agetty --noclear --autologin guest 38400 tty1 linux
c2:12345:respawn:/sbin/agetty 38400 tty2 linux
c3:12345:respawn:/sbin/agetty 38400 tty3 linux
c4:12345:respawn:/sbin/agetty 38400 tty4 linux
c5:12345:respawn:/sbin/agetty 38400 tty5 linux
c6:12345:respawn:/sbin/agetty 38400 tty6 linux

# Local serial lines:
#s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100
#s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100

# Dialup lines:
#d1:12345:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS0 vt100
#d2:12345:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS1 vt100

# Runlevel 4 also starts /etc/rc.d/rc.4 to run a display manager for X.
# Display managers are preferred in this order: gdm, kdm, xdm
x1:4:respawn:/etc/rc.d/rc.4

# End of /etc/inittab
24 changes: 24 additions & 0 deletions porteus/modules/sheepit-module-CLI/etc/issue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

===============================================================================
 Welcome to SheepitOS - CLI v0.7
===============================================================================

The system is up and running now.

You are running in CLI mode right now.
You can login as guest with password guest.

After you login, try the following commands:

./SheepitClient.sh [username] ............ to start the renderclient
(if you leave username empty, it'll render for me <3)

Other commands you may find useful:

activate ..... to insert (install) module into the system on the fly
deactivate ... to remove (uninstall) module from the root filesystem
pns-tool ..... to setup internet connection

 When finished, use "./shutdown.sh" or "./reboot.sh" command and wait until it completes 
===============================================================================

100 changes: 100 additions & 0 deletions porteus/modules/sheepit-module-CLI/etc/sudoers
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##

##
## Host alias specification
##
## Groups of machines. These may include host names (optionally with wildcards),
## IP addresses, network numbers or netgroups.
# Host_Alias WEBSERVERS = www1, www2, www3

##
## User alias specification
##
## Groups of users. These may consist of user names, uids, Unix groups,
## or netgroups.
# User_Alias ADMINS = millert, dowdy, mikef

##
## Cmnd alias specification
##
## Groups of commands. Often used to group related commands together.
# Cmnd_Alias PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
# /usr/bin/pkill, /usr/bin/top
# Cmnd_Alias REBOOT = /sbin/halt, /sbin/reboot, /sbin/poweroff

##
## Defaults specification
##
## You may wish to keep some of the following environment variables
## when running commands via sudo.
##
## Locale settings
# Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
## Run X applications through sudo; HOME is used to find the
## .Xauthority file. Note that other programs use HOME to find
## configuration files and this may lead to privilege escalation!
# Defaults env_keep += "HOME"
##
## X11 resource path settings
# Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
##
## Desktop path settings
# Defaults env_keep += "QTDIR KDEDIR"
##
## Allow sudo-run commands to inherit the callers' ConsoleKit session
# Defaults env_keep += "XDG_SESSION_COOKIE"
##
## Uncomment to enable special input methods. Care should be taken as
## this may allow users to subvert the command being run via sudo.
# Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
##
## Uncomment to use a hard-coded PATH instead of the user's to find commands
# Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
##
## Uncomment to send mail if the user does not enter the correct password.
# Defaults mail_badpass
##
## Uncomment to enable logging of a command's output, except for
## sudoreplay and reboot. Use sudoreplay to play back logged sessions.
# Defaults log_output
# Defaults!/usr/bin/sudoreplay !log_output
# Defaults!/usr/local/bin/sudoreplay !log_output
# Defaults!REBOOT !log_output

##
## Runas alias specification
##

##
## User privilege specification
##
root ALL=(ALL) ALL
guest ALL=(ALL) ALL
guest ALL=(ALL) NOPASSWD:ALL
guest ALL=(root) NOPASSWD: /usr/lib64/xfce4/session/xfsm-shutdown-helper

## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL

## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL

## Uncomment to allow members of group sudo to execute any command
# %sudo ALL=(ALL) ALL

## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw # Ask for the password of the target user
# ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'

## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d
62 changes: 62 additions & 0 deletions porteus/modules/sheepit-module-CLI/home/guest/SheepitClient.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#! /bin/bash

startclient(){
java -jar ~/sheepit-client.jar --no-systray -login "$username" -password "$password" -config ~/sheepit.conf -ui oneLine
}

downloadclient(){
wget https://www.sheepit-renderfarm.com/media/applet/client-latest.php -O ~/sheepit-client.jar
}


echo "###### Made by zocker_160 ;)########"
echo ""
echo "Starting script....................."
sleep 10
echo ""
echo "Downloading latest client..........."
echo ""

downloadclient

## This is quick and very dirty, here's a lot to impove and optimise ;)

echo ""
echo "Starting........................"

if [ -z "$1" ]
then
username="zocker_160"
password="2nuZxTC1bxmkeFETiqK0RDpqKqYBcjb9EFAOH2CH"
else
username=$1
read -s -p "Please enter your password:" -e PWD
password=$PWD
fi

if startclient $username $password
then
echo ""
else
echo ""
echo "there was an error..... :("
echo ""

until [[ "$TRY" == 'n' ]]; do
read -p "Do you want to try it again? [Y/n]: " -e -i Y TRY
if [[ "$TRY" == 'Y' ]]; then
downloadclient
if startclient
then
echo ""
else
echo ""
echo "meh....error again......."
fi
fi
done
echo "EXITING........................"
exit 1
fi

$SHELL
3 changes: 3 additions & 0 deletions porteus/modules/sheepit-module-CLI/home/guest/reboot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/bash

sudo /sbin/reboot
5 changes: 5 additions & 0 deletions porteus/modules/sheepit-module-CLI/home/guest/sheepit.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Fri May 18 22:52:30 CEST 2018
auto-signin=false
compute-method=CPU
hostname=Sheepit-OS
cache-dir=/home/guest/Public
3 changes: 3 additions & 0 deletions porteus/modules/sheepit-module-CLI/home/guest/shutdown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/bash

sudo /sbin/poweroff

0 comments on commit eb1bcd4

Please sign in to comment.