Halt Users
Halt there users!
Stop and starts user stuff
In [1]:
import os
In [2]:
#Make it easy to check on local pi/debian computers.
#List of everyone logged on and what machine they are logged
#into.
#Hostname id is last three/two characters of ip address.
In [3]:
hostndir = ('/home/wcmckee/sellcoffee/hostnames/')
In [4]:
os.listdir(hostndir)
Out[4]:
In [5]:
chosd = os.chdir(hostndir)
In [6]:
os.system('hostname > host.txt')
Out[6]:
In [7]:
rdhos = open('host.txt', 'r')
rdtxt = rdhos.read()
rdhos.close()
In [8]:
rdstp = rdtxt.strip('\n')
In [9]:
rdstp
Out[9]:
In [9]:
In [10]:
os.system('users > ' + rdstp)
Out[10]:
In [11]:
os.system('rm -rf host.txt')
Out[11]:
In [ ]:
print ('script success')
In [12]:
#whatip = raw_input('What ip address to rsync to: ')
#whaint = int(whatip)
In [13]:
#os.system('rsync -azP /home/wcmckee/sellcoffee/ wcmckee@192.168.1.2:/home/wcmckee/sellcoffee/')
Out[13]:
In [14]:
#os.system('rsync -azP /home/wcmckee/signinlca/ wcmckee@192.168.1.2:/home/wcmckee/signinlca/')
Out[14]:
In [15]:
#os.system('rsync -azP /home/wcmckee/github/ wcmckee@192.168.1.2:/home/wcmckee/github/')
Out[15]:
In [ ]: