2021-10-30 18:34:14 +02:00
|
|
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
|
|
|
|
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [hasRootAccess](./bitburner.ns.hasrootaccess.md)
|
|
|
|
|
|
|
|
## NS.hasRootAccess() method
|
|
|
|
|
|
|
|
Returns a boolean indicating whether or not the player has root access to the specified target server.
|
|
|
|
|
|
|
|
<b>Signature:</b>
|
|
|
|
|
|
|
|
```typescript
|
2021-10-30 21:46:34 +02:00
|
|
|
hasRootAccess(host: string): boolean;
|
2021-10-30 18:34:14 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
|
| --- | --- | --- |
|
2021-10-30 21:46:34 +02:00
|
|
|
| host | string | Host or IP of the target server |
|
2021-10-30 18:34:14 +02:00
|
|
|
|
|
|
|
<b>Returns:</b>
|
|
|
|
|
|
|
|
boolean
|
|
|
|
|
|
|
|
True if player has root access to the specified target server, and false otherwise.
|
|
|
|
|
|
|
|
## Remarks
|
|
|
|
|
2021-10-30 21:46:34 +02:00
|
|
|
RAM cost: 0.05 GB
|
2021-10-30 18:34:14 +02:00
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
|
2021-10-30 21:46:34 +02:00
|
|
|
```ts
|
2021-10-30 18:34:14 +02:00
|
|
|
if (hasRootAccess("foodnstuff") == false) {
|
|
|
|
nuke("foodnstuff");
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|