File: cps-auth

package info (click to toggle)
cloudprint 0.14-12
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 512 kB
  • sloc: python: 1,128; sh: 48; makefile: 16
file content (16 lines) | stat: -rwxr-xr-x 362 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

AUTHDIR=/var/lib/cloudprintd
AUTHFILE=$AUTHDIR/authfile.json

systemctl is-active cloudprintd >/dev/null
ACTIVE=$?

if [ ! -w $AUTHDIR ] ; then echo "Must run as root" ; exit 1 ; fi

if [ $ACTIVE -eq 0 ] ; then systemctl stop cloudprintd ; fi

rm -f $AUTHFILE
cloudprint -c -a $AUTHFILE

if [ $ACTIVE -eq 0 ] ; then systemctl start cloudprintd ; fi